Re: [wwwdocs] Mention -Wshift-overflow
On Mon, Jul 27, 2015 at 12:34:06AM +0200, Gerald Pfeifer wrote: > Hi Marek, > > On Tue, 21 Jul 2015, Marek Polacek wrote: > > +A new command-line option -Wshift-overflow has been > > + added for the C and C++ compilers, which warns about left shift > > + overflows. -Wshift-overflow=2 also warns about > > + left-shifting 1 into the sign bit. > > from what I can tell, this is enabled by default for modern > dialects of C and C++ (so many people will see new warnings > when upgrading) > > Shouldn't this be mentioned here? Ok, fixed. Thanks. Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.15 diff -u -r1.15 changes.html --- changes.html21 Jul 2015 09:30:14 - 1.15 +++ changes.html27 Jul 2015 11:14:11 - @@ -46,7 +46,8 @@ A new command-line option -Wshift-overflow has been added for the C and C++ compilers, which warns about left shift overflows. -Wshift-overflow=2 also warns about - left-shifting 1 into the sign bit. + left-shifting 1 into the sign bit. This warning is enabled by + default. C Marek
Re: [wwwdocs] Mention -Wshift-overflow
Hi Marek, On Tue, 21 Jul 2015, Marek Polacek wrote: > +A new command-line option -Wshift-overflow has been > + added for the C and C++ compilers, which warns about left shift > + overflows. -Wshift-overflow=2 also warns about > + left-shifting 1 into the sign bit. from what I can tell, this is enabled by default for modern dialects of C and C++ (so many people will see new warnings when upgrading) Shouldn't this be mentioned here? Gerald
[wwwdocs] Mention -Wshift-overflow
I've committed this patch to document recent addition. Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/changes.html,v retrieving revision 1.14 diff -u -r1.14 changes.html --- changes.html14 Jul 2015 12:55:08 - 1.14 +++ changes.html21 Jul 2015 09:29:51 - @@ -43,6 +43,10 @@ A new command-line option -Wshift-negative-value has been added for the C and C++ compilers, which warns about left shifting a negative value. +A new command-line option -Wshift-overflow has been + added for the C and C++ compilers, which warns about left shift + overflows. -Wshift-overflow=2 also warns about + left-shifting 1 into the sign bit. C Marek