This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45553] New: Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: "noloader at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2010 05:21:59 -0000
- Subject: [Bug c++/45553] New: Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi All,
A way to suppress the warning generated from the following would be a welcome
addition. A solution was proposed in [1], but I'd like a cleaner approach. I
believe suppressing the warning for a template parameter is the cleanest way to
dispose of the warning.
template< class T >
SomeClass<T>::SomeFunc(const T& t)
{
// warning: comparison of unsigned expression < 0 is always false
if(t < 0)
{
...
}
}
[1] http://gcc.gnu.org/ml/gcc-help/2010-08/msg00284.html
--
Summary: Warning Suppression: C++ Templates, Unsigned, and
"comparison of unsigned expression < 0 is always false"
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: noloader at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45553
- Follow-Ups:
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: pinskia at gcc dot gnu dot org
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: noloader at gmail dot com
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: pinskia at gcc dot gnu dot org
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: jakub at gcc dot gnu dot org
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: noloader at gmail dot com
- [Bug c++/45553] Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"
- From: pinskia at gcc dot gnu dot org