[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-06 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2010-09-06 06:33 ---
In G++ 4.6+ you can do:
int i;
unsigned j;

template class T
void
bar (const T t)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored -Wtype-limits
  if (t  0)
#pragma GCC diagnostic pop
{
  i++;
}
}

void foo (void)
{
  bar (i);
  bar (j);
}


-- 


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



[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-06 Thread noloader at gmail dot com


--- Comment #5 from noloader at gmail dot com  2010-09-06 06:45 ---
(In reply to comment #4)
 In G++ 4.6+ you can do:
 int i;
 unsigned j;
 
 template class T
 void
 bar (const T t)
 {
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored -Wtype-limits
   if (t  0)
 #pragma GCC diagnostic pop
 {
   i++;
 }
 }
 
 void foo (void)
 {
   bar (i);
   bar (j);
 }
 
Thanks Jakub.

All those #pragmas look like MS code. I thought Stallman hated those things (I
seem to recall #pragma once being the source of a lot of in-house bickering).
Did he get over ruled by committee?


-- 


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



[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-06 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2010-09-06 06:48 ---
I thought Stallman hated those things

The reason why Stallman hated them is that they did not work with macros and
that changed with C99 adding support of  _Pragma which can be used in macros
now.  So his argument against Pragma went away when that come in.


-- 


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



[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-05 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2010-09-06 05:24 ---


*** This bug has been marked as a duplicate of 11856 ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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



[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-05 Thread noloader at gmail dot com


--- Comment #2 from noloader at gmail dot com  2010-09-06 05:35 ---
(In reply to comment #1)
 
 *** This bug has been marked as a duplicate of 11856 ***
 
Thanks Andrew. For the record, I don't really consider it a bug - its closer to
undesired behavior when working with generics/templates and the way the parts
mesh.


-- 

noloader at gmail dot com changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


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



[Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and comparison of unsigned expression 0 is always false

2010-09-05 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2010-09-06 05:39 ---
It is still a dup of bug 11856.  Note the use of bug here is really dealing
with how do you describe all issues (enhancements or otherwise).  The use is
not saying it is a software bug in the normal sense.

*** This bug has been marked as a duplicate of 11856 ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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