Article View: gnu.g++.bug
Article #1229@ Incorrect warning message
From: Taed Nelson
Date: Sun, 22 Nov 1992 01:26
Date: Sun, 22 Nov 1992 01:26
26 lines
1087 bytes
1087 bytes
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);
}
Technical Details
Message-ID:
<9211220126.AA11152@berlioz.nsc.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!berlioz.nsc.com!nelsonShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!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