home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!berlioz.nsc.com!nelson
- From: nelson@berlioz.nsc.com (Taed Nelson)
- Subject: @ Incorrect warning message
- Message-ID: <9211220126.AA11152@berlioz.nsc.com>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Sun, 22 Nov 1992 01:26:39 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 27
-
- I'm running a > 2.0 G++ on a Sun SparcStation w/ SunOS 4.0.1.
-
- I'm not sure of the version since "g++ -version" no longer works.
-
- The following code will generate:
- test2.cc:7: warning: ordered comparison between signed and unsigned
- when clearly, it is comparing two unsigned values. The problem only arises
- with unsigned characters.
-
- The command line is:
- g++ -I/usr/local/gnu/include/g++ -ansi -Dunix -Dsun -Wall
- -fno-strict-prototype -DDEBUG -g -Wunused test2.cc
-
- ---------------------------------------------------
-
- int main (void)
- {
- unsigned int uint = 5;
- unsigned char uchar = 6;
-
- if (uint < uchar) {
- uchar = uint;
- }
-
- return (0);
- }
-
-