This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80138] spurious warning: assuming signed overflow does not occur when ...
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Mar 2017 10:21:43 +0000
- Subject: [Bug c++/80138] spurious warning: assuming signed overflow does not occur when ...
- Auto-submitted: auto-generated
- References: <bug-80138-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80138
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think that including -Wstrict-overflow in -Wall is a mistake given it is a
warning that assumes you assume signed overflow wraps and then tells you the
points where the compiler assumed otherwise.
But nowadays not all (-Wall) people assume that signed overflow wraps.
Implementation-wise I'd also rather alias -fno-strict-overflow to -fwrapv...
(and remove -Wstrict-overflow entirely).
-Wstrict-overflow is _not_ warning about cases where GCC somehow computed
that signed arithmetic (might) overflow. (that's IMHO impossible without
very many false positives)