[C/C++ PATCH] shift with negative or too big count warning (PR c/48418)

Joseph S. Myers joseph@codesourcery.com
Tue Jan 8 22:33:00 GMT 2013


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



More information about the Gcc-patches mailing list