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++/45553] New: Warning Suppression: C++ Templates, Unsigned, and "comparison of unsigned expression < 0 is always false"


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


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