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

Reply via email to