From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [commit] Fix unitialized warning in macroexp.c
Date: Thu, 31 Mar 2011 16:19:00 -0000 [thread overview]
Message-ID: <1301586070.9154.20.camel@hactar> (raw)
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)
reply other threads:[~2011-03-31 15:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301586070.9154.20.camel@hactar \
--to=bauerman@br.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox