This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/59301] Please enable -Wstrict-overflow as part of -Wextra


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59301

Vincent LefÃvre <vincent-gcc at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-gcc at vinc17 dot net

--- Comment #1 from Vincent LefÃvre <vincent-gcc at vinc17 dot net> ---
(In reply to Joerg Wunsch from comment #0)
> I think it would be much better to include -Wstrict-overflow into -Wextra, 
> so people get aware of the potential problems.

I disagree: there are currently too many false positives.

For your particular problem, the bug is somewhere else: the undefined behavior
in --i for some value, and this is now detected by GCC:

ypig:~> gcc-4.9 -O2 -fstrict-overflow -c z.c
z.c: In function âmainâ:
z.c:4:11: warning: iteration 2147483648u invokes undefined behavior
[-Waggressive-loop-optimizations]
     while (--i)
           ^
z.c:4:11: note: containing loop
ypig:~> gcc-4.9 --version
gcc-4.9.real (Debian 4.9-20140411-2) 4.9.0 20140411 (prerelease)
[gcc-4_9-branch revision 209311]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So, IMHO, this bug should be closed.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]