Compiler error OR missing error message

Philippe Bouchard philippeb@corel.com
Mon Nov 13 15:20:00 GMT 2000


The following program:
#include <iostream>
int main()
{
  int a[] = {0, 1, 2, a[0]};
  std::cout << a[0] << ", " << a[1] <<
", " << a[2] << ", " << a[3] << std::endl;
}
Outputs:
0, 1, 2, 1074463848
Under:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
This is either a compiler error, because the a[0] is supposed to be
initialized when initializing a[3], or I am trying to access an undefined
variable and the compiler or not reporting so.
Thank you.
begin:vcard 
n:Bouchard;Philippe
x-mozilla-html:FALSE
org:Corel Linux
adr:;;;;;;
version:2.1
email;internet:philippeb@corel.com
title:Software Engineer
x-mozilla-cpt:;0
fn:Philippe Bouchard
end:vcard


More information about the Gcc-bugs mailing list