Fix: incorrect compiler warning
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Sep 2014 16:24:07 +0000 (12:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Sep 2014 16:25:28 +0000 (12:25 -0400)
The compiler does not see that *target will necessarily set the values.
Initialize the variables to 0 to silence uninitialized variable warning.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-visitor-generate-io-struct.c

index 9acda56728c28823eac010f4bf738f7c1b4c1a73..5f47930f23a428f064b2c137152bad335867c060 100644 (file)
@@ -994,7 +994,7 @@ int ctf_enumerator_list_visit(FILE *fd, int depth,
 
        q = g_quark_from_string(enumerator->u.enumerator.id);
        if (enum_declaration->integer_declaration->signedness) {
-               int64_t start, end;
+               int64_t start = 0, end = 0;
                int nr_vals = 0;
 
                bt_list_for_each_entry(iter, &enumerator->u.enumerator.values, siblings) {
@@ -1031,7 +1031,7 @@ int ctf_enumerator_list_visit(FILE *fd, int depth,
                last->u.s = end + 1;
                bt_enum_signed_insert(enum_declaration, start, end, q);
        } else {
-               uint64_t start, end;
+               uint64_t start = 0, end = 0;
                int nr_vals = 0;
 
                bt_list_for_each_entry(iter, &enumerator->u.enumerator.values, siblings) {
This page took 0.025883 seconds and 4 git commands to generate.