🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by "Douglas C. Schmidt" Fri, 11 Nov 1988 03:47
g++ 1.27 fails to accept valid C and C++ construct.
#1523
Author: "Douglas C. Schmidt"
Date: Fri, 11 Nov 1988 03:47
48 lines
2012 bytes
Hi,

   The following short program does not compile under g++ 1.27.
However, I believe that it is valid ANSI-C, and it works under both
gcc and AT&T's CC 1.2.1.  After all, a[i] is *obviously* equivalent to
i[a] ;-)...

----------------------------------------
#include <stdio.h>

main ( int argc, char **argv ) {
   for ( ; *argv; argv++) {
      int i;
      for ( i = 0; i [ *argv ]; i++ ) {
         putchar( i [ *argv ] );
      }
      putchar( '\n' );
   }
}
----------------------------------------

The compiler diagnostic is:

----------------------------------------
g++ version 1.27.0
 echo use .cc filename extension!
use .cc filename extension!
 /usr/public/lib/g++/gcc-cpp+ -v -I/cd/ua/schmidt/include/ -undef
-D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix test.C /tmp/cca21732.cpp
GNU CPP version 1.27.0
 /usr/public/lib/g++/gcc-c++ /tmp/cca21732.cpp -quiet -dumpbase test.C
-fchar-charconst -noreg -version -o /tmp/cca21732.s

test.C:6: [] applied to non-pointer type
test.C:7: [] applied to non-pointer type
test.C:7: [] applied to non-pointer type
GNU C++ version 1.27.0 (sparc) compiled by GNU C version 1.28.
----------------------------------------

thanks,

Doug
----------------------------------------
schmidt@bonnie.ics.uci.edu (ARPA) |   Per me si va nella cita dolente.
                                  |   Per me si va nell' etterno dolore.
                                  |   Per me si va tra la perduta gente.
                                  |   Lasciate ogni speranza voi ch' entrate.
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