public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Martin Sebor <msebor@gmail.com>,
	Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] have -Wformat-overflow handle -fexec-charset (PR 80503)
Date: Thu, 27 Apr 2017 05:07:00 -0000	[thread overview]
Message-ID: <20170426223418.GV1809@tucnak> (raw)
In-Reply-To: <alpine.DEB.2.20.1704262224580.2840@digraph.polyomino.org.uk>

On Wed, Apr 26, 2017 at 10:26:56PM +0000, Joseph Myers wrote:
> On Wed, 26 Apr 2017, Martin Sebor wrote:
> 
> > Testing my solution for bug 77671 (missing -Wformat-overflow
> > sprintf with "%s") caused a regression in the charset/builtin2.c
> > test for bug 25120 (builtin *printf handlers are confused by
> > -fexec-charset).  That led me to realize that like -Wformat
> > itself, the whole gimple-ssa-sprintf pass is oblivious to
> > potential differences between the source character set on
> > the host and the execution character set on the target.  As
> > a result, when the host and target sets are different, the
> > pass misinterprets ordinary format characters as special
> > (e.g., parts of directives) and vice versa.
> > 
> > The attached patch implements a simple solution to this problem
> > by introducing a mapping between the two sets.
> 
> target_strtol10 appears to do no checking for overflow, which I'd expect 
> would result in nonsensical results for large width values overflowing 
> host long (whereas strtol would reliably return LONG_MAX in such cases).

Also, can't there be a way to shortcut all this processing if the
charsets are the same?  And is it a good idea if every pass that needs to do
something with the exec charset chars caches its own results of the
langhook?

	Jakub

  reply	other threads:[~2017-04-26 22:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 22:27 Martin Sebor
2017-04-27  3:39 ` Joseph Myers
2017-04-27  5:07   ` Jakub Jelinek [this message]
2017-04-27 22:52     ` Martin Sebor
2017-04-28 16:35       ` Jeff Law
2017-04-28 16:37         ` Jakub Jelinek
2017-04-28 17:05           ` Jeff Law
2017-04-28 18:32         ` Martin Sebor
2017-04-28 19:14           ` Jeff Law
2017-04-29 20:44           ` Andreas Schwab
2017-05-03 14:35             ` Christophe Lyon
2017-05-03 15:02               ` Martin Sebor
2017-05-03 15:24                 ` Christophe Lyon
2017-06-02 15:38                   ` Renlin Li
2017-06-04 22:24                     ` Martin Sebor
2017-06-13  8:16                       ` Renlin Li
2017-06-20 11:00                         ` Renlin Li
2018-01-31 17:57                           ` Renlin Li
2018-02-01  0:41                             ` Martin Sebor
2018-02-01 11:54                               ` Renlin Li
2018-02-01 18:27                                 ` Martin Sebor

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=20170426223418.GV1809@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=msebor@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).