schmidt%siam.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") (01/02/89)
Hi,
The following short C++ program fails to compile with g++ 1.32.
It does compile with gcc 1.32, and also compiles if
int (*ap)[20];
is moved to the outer scope or declared with storage class static.
Interestingly, AT&T cfront 1.2.1 also botches this.
Here's the code:
----------------------------------------
main ( ) {
int a [ 10 ] [ 20 ];
int (*ap)[ 20 ];
}
----------------------------------------
And here are the diagnostics:
----------------------------------------
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/cca06496.cpp
GNU CPP version 1.32
/usr/public/lib/g++/gcc-c++ /tmp/cca06496.cpp -quiet -dumpbase test.c
-fstrength-reduce -finline-functions -fmemoize-lookups -fsave-memoized
-fchar-charconst -version -o /tmp/cca06496.s
GNU C++ version 1.32.0 (sparc) compiled by GNU C version 1.31.
In function int main ():
test.c:5: `ap' was not declared (first use this function)
test.c:5: (Each undeclared identifier is reported only once
test.c:5: for each function it appears in.)
test.c:6: warning: variable `a' never used
----------------------------------------
Doug