This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56497] comparison is always true due to limited range of data type
- 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: Fri, 01 Mar 2013 17:20:38 +0000
- Subject: [Bug c++/56497] comparison is always true due to limited range of data type
- Auto-submitted: auto-generated
- References: <bug-56497-4@http.gcc.gnu.org/bugzilla/>
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.