[glib/unused-warning] Initialize a variable
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/unused-warning] Initialize a variable
- Date: Mon, 18 Feb 2019 09:53:21 +0000 (UTC)
commit f011be9c4b6758949c498713e68d2154e88f26ed
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Feb 18 09:50:26 2019 +0000
Initialize a variable
Compilers get confused when variables are initialized by a function by
taking them as reference in an out argument; this, coupled with the fact
that C does not initialize variables by default, most commonly results
in a "maybe uninitialized" compiler warning.
gio/tests/gsettings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
index 640f3a31c..afc4e1fd8 100644
--- a/gio/tests/gsettings.c
+++ b/gio/tests/gsettings.c
@@ -1860,7 +1860,7 @@ test_strinfo (void)
"\0\0\0\xff";
const guint32 *strinfo = (guint32 *) array;
guint length = sizeof array / 4;
- guint result;
+ guint result = 0;
{
/* build it and compare */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]