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++/56497] comparison is always true due to limited range of data type


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

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2013-03-01 17:20:38 UTC ---
(In reply to comment #0)
> Created attachment 29563 [details]
> g++ -Wtype-limits test.cxx
> 
> It would be really nice if -Wtype-limits would catch all occurences in the
> following test case.

That seems nearly impossible. The warning is emitted in the FE, and this would
require inlining and/or constant propagation into function calls. Not likely to
ever happen in GCC. You need something like http://clang-analyzer.llvm.org/ or
http://cppcheck.sourceforge.net/. Better report a bug to them.


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