This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/49283] pointless warning with -Wstrict-overflow
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 5 Jun 2011 09:01:00 +0000
- Subject: [Bug middle-end/49283] pointless warning with -Wstrict-overflow
- Auto-submitted: auto-generated
- References: <bug-49283-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49283
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |manu at gcc dot gnu.org
Component|c |middle-end
--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-06-05 09:00:41 UTC ---
(In reply to comment #0)
> 2) If the function yyparse is removed from foo.c, the warning disappears.
> So apparently the warning is generated when inlining yylex into yyparse.
> It makes no sense to have no warning in yylex by itself but have a warning
> when it gets inlined.
Unfortunately, this perfectly makes sense and, in fact, it happens often.
Inlining exposes more optimization opportunities and hence more changes of
making use of undefined behaviour. See:
http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_21.html#more