Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: David Carlton <carlton@kealia.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: -Wformat
Date: Fri, 01 Aug 2003 16:08:00 -0000	[thread overview]
Message-ID: <3F2A903E.9000908@redhat.com> (raw)
In-Reply-To: <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



  reply	other threads:[~2003-08-01 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-01 15:49 -Wformat David Carlton
2003-08-01 16:08 ` Andrew Cagney [this message]
2003-08-01 16:18   ` -Wformat David Carlton
2003-08-01 16:30     ` -Wformat Andrew Cagney
2003-08-01 16:33       ` -Wformat Daniel Jacobowitz
2003-08-01 16:46       ` -Wformat David Carlton
2003-08-01 16:48         ` -Wformat Daniel Jacobowitz
2003-08-01 17:53           ` -Wformat Andrew Cagney
2003-08-01 18:25 -Wformat Michael Elizabeth Chastain

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=3F2A903E.9000908@redhat.com \
    --to=ac131313@redhat.com \
    --cc=carlton@kealia.com \
    --cc=gdb@sources.redhat.com \
    /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