home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / g / bug / 1856 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1.0 KB  |  40 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!berlioz.nsc.com!nelson
  3. From: nelson@berlioz.nsc.com (Taed Nelson)
  4. Subject: @ Incorrect warning message
  5. Message-ID: <9211220126.AA11152@berlioz.nsc.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sun, 22 Nov 1992 01:26:39 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 27
  12.  
  13. I'm running a > 2.0 G++ on a Sun SparcStation w/ SunOS 4.0.1.
  14.  
  15. I'm not sure of the version since "g++ -version" no longer works.
  16.  
  17. The following code will generate:
  18.     test2.cc:7: warning: ordered comparison between signed and unsigned
  19.   when clearly, it is comparing two unsigned values.  The problem only arises
  20.   with unsigned characters.
  21.  
  22. The command line is:
  23.     g++ -I/usr/local/gnu/include/g++ -ansi -Dunix -Dsun -Wall
  24.         -fno-strict-prototype -DDEBUG -g -Wunused test2.cc
  25.  
  26. ---------------------------------------------------
  27.  
  28. int main (void)
  29. {
  30.     unsigned int uint = 5;
  31.     unsigned char uchar = 6;
  32.  
  33.     if (uint < uchar) {
  34.         uchar = uint;
  35.     }
  36.  
  37.     return (0);
  38. }
  39.  
  40.