schmidt%crimee.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") (01/02/89)
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