Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: David Carlton <carlton@kealia.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] some -Wformat-nonliteral changes
Date: Mon, 04 Aug 2003 14:06:00 -0000	[thread overview]
Message-ID: <3F2E6837.4010201@redhat.com> (raw)
In-Reply-To: <yf2isphunls.fsf@hawaii.kealia.com>

> As promised, here are the easy -Wformat-nonliteral changes.  Most of
> them consist of replacing calls like fprintf(stream, foo) with
> fputs(foo, stream).  A few of them consist of replacing error(msg)
> with error("%s",msg).  And one of them is an actual bug fix - there's
> a call to internal_error that left out __FILE__ and __LINE__.

Insert expression of disbelief:

> -      internal_error ("Error converting character `%d' from `%s' to `%s' "
> +      internal_error (__FILE__, __LINE__,
> +		      "Error converting character `%d' from `%s' to `%s' "
>                        "character set: %s",
>                        from_char, ci->from->name, ci->to->name,
>                        safe_strerror (errno));

The other changes are also, arguably, bug fixes.  There's no guarentee 
that there isn't a % in the buffer.

> Having said that, there's still a lot of warnings triggered by
> -Wformat-nonliteral; some of them are in situations with a fairly easy
> workaround, but some of them are a little more delicate.  I would
> definitely recommend that the -Wformat-nonliteral patch be reverted
> for the time being, because it's breaking compiles for some of us.
> 
> I've tested this with GCC 3.2, i686-pc-linux-gnu, DWARF-2; no new
> regressions.  It also doesn't turn up any regressions on GDB 6.0; I'd
> lean towards applying the internal_error bug fix part of it to the
> branch, but I don't have much of an opinion one way or another about
> applying the entire patch.
> 
> OK to apply?  It should all be obvious, but I might as well have
> another set of eyes proofreading it.

Yes, ok, and yes, the internal_error patch should go onto the branch.

Before reverting -Wformat-nonliteral, I'd like to see exactly what the 
damange is - it's clearly finding bugs.

Andrew



  reply	other threads:[~2003-08-04 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-01 20:30 David Carlton
2003-08-04 14:06 ` Andrew Cagney [this message]
2003-08-04 17:14   ` David Carlton

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=3F2E6837.4010201@redhat.com \
    --to=ac131313@redhat.com \
    --cc=carlton@kealia.com \
    --cc=gdb-patches@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