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]

Overly agressive warning wrt. unsigned


The following snippet, compiled with `egcs-1.1-cvs -Wunsigned`

  bool f();

  void g(unsigned u) {
     if( u > 1 );
     if( u > 2 );
     if( u > (f() ? 1 : 2) ) ;
     }

generates a warning which I really don't like[TM]:

  x.cc: In function `void g(unsigned int)':
  x.cc:6: warning: comparison between signed and unsigned


Note that this only occurs with the ? : expression.

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/



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