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 middle-end/49283] pointless warning with -Wstrict-overflow


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


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