Thread View: gnu.g++.bug
1 messages
1 total messages
Started by "Douglas C. Schmidt"
Sun, 01 Jan 1989 21:13
g++ 1.32 fails to give warning for erroneous assignments
Author: "Douglas C. Schmidt"
Date: Sun, 01 Jan 1989 21:13
Date: Sun, 01 Jan 1989 21:13
38 lines
1794 bytes
1794 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads