This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C/C++ PATCH] shift with negative or too big count warning (PR c/48418)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 8 Jan 2013 22:32:47 +0000
- Subject: Re: [C/C++ PATCH] shift with negative or too big count warning (PR c/48418)
- References: <20130108200403.GN7269@tucnak.redhat.com>
On Tue, 8 Jan 2013, Jakub Jelinek wrote:
> Hi!
>
> As discussed in the PR, on the following testcase we've regressed with the
> introduction of c_fully_fold, when the C FE normally warns the argument
> isn't folded yet. Fixed by also warning in c_fully_fold_internal, if before
> that function the shift count wasn't INTEGER_CST and after it it is.
>
> The testcase also revealed a regression on the C++ FE side, caused by
> SIZEOF_EXPR folding deferral.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
The C front-end changes are OK. Properly diagnostic messages inside ? :
conditionals should be marked up with G_() to ensure that both cases are
extracted for translation, though in this case it doesn't matter much
given that the message wording should stay identical to other copies of
the same messages.
--
Joseph S. Myers
joseph@codesourcery.com