public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-11856-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c++/11856] New: Wrong warning regarding assert
@ 2003-08-08 14:25 o dot kullmann at swansea dot ac dot uk
  2003-08-10  2:35 ` [Bug c++/11856] unsigned warning in template pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: o dot kullmann at swansea dot ac dot uk @ 2003-08-08 14:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Wrong warning regarding assert
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: o dot kullmann at swansea dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org

<file AssertWarning.cpp> 
---------------------------------------- 
#include <cassert> 
void f(unsigned char c) { 
  assert(0 <= c and c <= 2); 
} 
int main() { 
  f(5); 
} 
---------------------------------------- 
yields: 
> g++ AssertWarning.cpp 
AssertWarning.cpp: In function `void f(unsigned char)': 
AssertWarning.cpp:3: warning: comparison is always true due to limited range 
of data type 
 
which is wrong: Running it yields (as it should be): 
> ./a.out 
a.out: AssertWarning.cpp:3: void f(unsigned char): Assertion `0 <= c and c <= 
2' failed. 
Aborted. 
 
Tested Versions: 3.3 and 3.2.1 (same behaviour). 
(Platform: Linux (Suse 8.0)) 
 
I'm writing a generic library, and this warning shows up all over the 
place, and since the warning messages typically are *very* long (due 
to the deeply nested template names), the output of g++ is rendered 
unreadable. 
 
Since it doesn't seem to be possible to inhibit this warning message (!), 
the only work around is to use 
 
g++ -w 
 
inhibiting *all* warnings.


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2013-06-06 21:39 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-11856-781@http.gcc.gnu.org/bugzilla/>
2006-01-21 20:38 ` [Bug c++/11856] unsigned warning in template pinskia at gcc dot gnu dot org
2006-01-23  1:17 ` gdr at gcc dot gnu dot org
2006-01-23  1:23 ` gdr at cs dot tamu dot edu
2007-01-09 14:36 ` manu at gcc dot gnu dot org
2007-01-17  0:47 ` manu at gcc dot gnu dot org
2007-01-17  0:59 ` gdr at cs dot tamu dot edu
2007-01-17  1:11 ` manu at gcc dot gnu dot org
2007-01-17  1:30 ` gdr at cs dot tamu dot edu
2007-01-17  1:33 ` tromey at gcc dot gnu dot org
2007-01-17  1:46 ` gdr at cs dot tamu dot edu
2007-01-17  3:49 ` manu at gcc dot gnu dot org
2007-01-17 12:32 ` tromey at gcc dot gnu dot org
2007-01-17 13:47 ` gdr at cs dot tamu dot edu
2007-02-06 13:49 ` manu at gcc dot gnu dot org
2007-05-20 20:34 ` manu at gcc dot gnu dot org
2007-05-20 20:46 ` manu at gcc dot gnu dot org
2008-01-14 21:29 ` pinskia at gcc dot gnu dot org
2008-01-14 22:44 ` pinskia at gcc dot gnu dot org
2008-01-15  0:12 ` manu at gcc dot gnu dot org
2010-05-07 13:16 ` bangerth at gmail dot com
2010-09-06  5:25 ` pinskia at gcc dot gnu dot org
2010-09-06  5:39 ` pinskia at gcc dot gnu dot org
     [not found] <bug-11856-4@http.gcc.gnu.org/bugzilla/>
2012-05-14 11:33 ` manu at gcc dot gnu.org
2012-05-14 13:09 ` jason at gcc dot gnu.org
2012-05-14 13:10 ` paolo.carlini at oracle dot com
2012-05-15 15:22 ` paolo.carlini at oracle dot com
2012-05-23 18:27 ` paolo.carlini at oracle dot com
2013-06-06 21:39 ` paolo.carlini at oracle dot com
2003-08-08 14:25 [Bug c++/11856] New: Wrong warning regarding assert o dot kullmann at swansea dot ac dot uk
2003-08-10  2:35 ` [Bug c++/11856] unsigned warning in template pinskia at gcc dot gnu dot org
2003-08-10  2:36 ` pinskia at gcc dot gnu dot org
2003-08-23  1:12 ` dhazeghi at yahoo dot com
2004-05-30 17:02 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).