This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: -Wformat
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: David Carlton <carlton at kealia dot com>
- Cc: gdb <gdb at sources dot redhat dot com>
- Date: Fri, 01 Aug 2003 12:07:26 -0400
- Subject: Re: -Wformat
- References: <yf2lludwf7w.fsf@hawaii.kealia.com>
I just downloaded mainline GDB for the first time in far too long, and
the recent -Wformat-nonliteral change breaks -Werror for me (compiling
with GCC 3.2.3). I'll include the stderr output of 'make -k' from
within gdb/ after my signature; I haven't investigated them
thoroughly, but what I've look at makes me think that
-Wformat-nonliteral isn't a good idea.
`works for me'. I tested it with:
gcc version 2.95.3 20010315 (release) (NetBSD nb3)
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2)
Looking at the first problem:
breakpoint.c: In function `insert_breakpoints':
breakpoint.c:916: warning: format not a string literal, argument types
not checked
it revealed this little `gem':
static char message1[] = "Error inserting catchpoint %d:\n";
static char message[sizeof (message1) + 30];
...
sprintf (message, message1, b->number);
While getting the option working with a current GCC could mean more
work, I'm not convinced that it's a bad idea.
Andrew