* [commit] Fix unitialized warning in macroexp.c
@ 2011-03-31 16:19 Thiago Jung Bauermann
0 siblings, 0 replies; only message in thread
From: Thiago Jung Bauermann @ 2011-03-31 16:19 UTC (permalink / raw)
To: gdb-patches ml
Hi,
When compiling with -O3 (gcc 4.4.5), the build fails with:
cc1: warnings being treated as errors
/home/bauermann/trabalho/src/src/gdb/macroexp.c: In function âmaybe_expandâ:
/home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: error: âva_arg_name.lenâ may be used uninitialized in this function
/home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: note: âva_arg_name.lenâ was declared here
/home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: error: âva_arg_name.textâ may be used uninitialized in this function
/home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: note: âva_arg_name.textâ was declared here
make: *** [macroexp.o] Error 1
I committed the following patch to fix the build.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
2011-03-31 Thiago Jung Bauermann <bauerman@br.ibm.com>
* macroexp.c (expand): Avoid uninitialized variable
compiler warning.
Index: macroexp.c
===================================================================
RCS file: /cvs/src/src/gdb/macroexp.c,v
retrieving revision 1.26
diff -u -r1.26 macroexp.c
--- macroexp.c 9 Jan 2011 03:20:33 -0000 1.26
+++ macroexp.c 31 Mar 2011 15:39:41 -0000
@@ -1183,7 +1183,7 @@
struct macro_buffer *argv = NULL;
struct macro_buffer substituted;
struct macro_buffer substituted_src;
- struct macro_buffer va_arg_name;
+ struct macro_buffer va_arg_name = {0};
int is_varargs = 0;
if (def->argc >= 1)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-31 15:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 16:19 [commit] Fix unitialized warning in macroexp.c Thiago Jung Bauermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox