Path: utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.edu From: schmidt%crimee.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.g++.bug Subject: g++ 1.32 fails to give warning for erroneous assignments Message-ID: <8901011321.aa03698@PARIS.ICS.UCI.EDU> Date: 1 Jan 89 21:13:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 38 Hi, The following demonstrates two problems with g++ 1.32: ---------------------------------------- main ( int, char *[ ] ) { unsigned int i = -1000; // should give a warning char a = 103203.9e1; // generates illegal asm output } ---------------------------------------- AT&T cfront 1.2.1 gives the following error diagnostics for this: ---------------------------------------- CC test.C: "test.C", line 4: warning: negative initializer for unsigned i "test.C", line 4: warning: double assigned to char ---------------------------------------- However, g++ 1.32 gives no compiler diagnostics, but generates erroneous assembly code: ---------------------------------------- g++ version 1.32.0 /usr/public/lib/g++/gcc-cpp -+ -v -I/cd/ua/schmidt/include/ -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix test.C /tmp/cca06645.cpp GNU CPP version 1.32 /usr/public/lib/g++/gcc-c++ /tmp/cca06645.cpp -quiet -dumpbase test.C -fstrength-reduce -finline-functions -fmemoize-lookups -fsave-memoized -fchar-charconst -noreg -version -o /tmp/cca06645.s GNU C++ version 1.32.0 (sparc) compiled by GNU C version 1.31. as /tmp/cca06645.s -o test.o as: "/tmp/cca06645.s", line 14: error: constant value must be between -4096 and 4095 ---------------------------------------- Doug