On Mon, 27 Apr 2015, Marek Polacek wrote:
> trigger by default. One change is that we reject programs that use shift with
> undefined behavior in a context where a constant expression is required, thus
> e.g. enum E { A = -1 << 0 };
> But I hope that's reasonable.
That seems appropriate (for C99 and above).
But if someone explicitly uses -Wshift-negative-value, I'd expect that to
produce the warnings (as opposed to the rejections where a constant
expression is required) even in C90 mode. That is, for the warnings, I
think flag_isoc99 should maybe affect the default (whether -Wextra enables
the warning, or whatever such approach gets taken), but not whether
-Wshift-negative-value, given that the option has been enabled, produces
warnings.
--
Joseph S. Myers
[email protected]