From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078611110241.tru64-unix-managers.marc@archive.invalid> From: Ray Lauff Date: Mon, 07 Apr 1997 03:44:43 +0000 To: tru64-unix-managers Subject: DEC cxx question X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078611110241 I am trying to compile a test C++ program on DU 4.0b using "DEC C++ V5.4-006 on Digital UNIX (Alpha)". According to the December 96 ANSI standard, the following "for" loops should be valid: #include ------------------------------------------------------------------ main() { const int last_a = 8; int a[last_a]; for ( int i = 0, j = 0; i < last_a; a[i++] = ( j += 2 ) ); for ( int i = 0; i < last_a; i++ ) cout << "a[" << i << "] = " << a[i] << endl; } ------------------------------------------------------------------ When I compile the program, I get the following error message: cxx: Error: test.C, line 10: In this declaration, "i" has no linkage and has a prior declaration in this scope at line number 8 in file test.C. for ( int i = 0; i < last_a; i++ ) ------------------^ Is this a fault in the DEC C++ compiler? The program compiles correctly under g++. Am I missing a flag on the compiler that I should know about :) ? Thanks in advance for any info. ray -- Ray Lauff : ray@thunder.ocis.temple.edu : (215) 204-5678 : Temple University