This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, preprocessor]: Fix 'may be used uninitialized' warning
- From: "Uros Bizjak" <ubizjak at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 4 Jul 2007 10:58:06 +0200
- Subject: [PATCH, preprocessor]: Fix 'may be used uninitialized' warning
Hello!
For my '-O3 -ffast-math' uber-optimized build, bootstrap dies
compiling libcpp/traditional.c due to a bunch of 'may be used
uninitialized' warnings.
Attached patch fixes warnigns and allows bootstrap to finish.
2007-07-04 Uros Bizjak <ubizjak@gmail.com>
* traditional.c (_cpp_scan_out_logical_line): Initialize
fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
fmacro.args to prevent 'may be used uninitialized' warning.
I'll commit this patch as obvious to mainline SVN.
Uros.
Index: traditional.c
===================================================================
--- traditional.c (revision 126307)
+++ traditional.c (working copy)
@@ -1,5 +1,5 @@
/* CPP Library - traditional lexical analysis and macro expansion.
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
Contributed by Neil Booth, May 2002
This program is free software; you can redistribute it and/or modify it
@@ -353,6 +353,11 @@ _cpp_scan_out_logical_line (cpp_reader *
const uchar *start_of_input_line;
fmacro.buff = NULL;
+ fmacro.args = NULL;
+ fmacro.node = NULL;
+ fmacro.offset = 0;
+ fmacro.line = 0;
+ fmacro.argc = 0;
quote = 0;
header_ok = pfile->state.angled_headers;