From 07d348fbd874ee4bd1c7d431d2d5385221760189 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 12 Dec 2012 14:12:21 +0900 Subject: [PATCH] Fix an uninitialized warning from recent gcc. Nifty: if you pass a struct via reference to a function, and a field of that struct may be both set and not set (eg, set only in an if statement), gcc will report that field assuming that fields that are never set will be set by the function (my interpretation). * taniwha ponders the flow analysis for that --- tools/qfcc/source/emit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index 638b3a1e2..40c03803c 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -137,11 +137,9 @@ add_statement_def_ref (def_t *def, dstatement_t *st, int field) int alias_depth = 0; expr_t alias_depth_expr; + alias_depth_expr.file = def->file; + alias_depth_expr.line = def->line; while (def->alias) { - if (!alias_depth) { - alias_depth_expr.file = def->file; - alias_depth_expr.line = def->line; - } alias_depth++; def_t *a = def; offset_reloc |= def->offset_reloc;