g++ accepts variable size in an array decl

Roman Kagan Roman.Kagan@in2p3.fr
Tue Nov 16 15:53:00 GMT 1999


       Hi!

I've discovered by accident that g++ accepts with no complaint code
like this (it isn't on the list of well known bugs, is it?):

void f(x)
{
  int i;
  double w[i];
}

Applicable to at least egcs-1.1.2 and gcc-2.95.* on i686-pc-linux-gnu,
powerpc-ibm-aix4.3.2.0, hppa2.0-hp-hpux10.20.

When run under gdb, it reported that `w' has type `double (*)[0]'.

  Cheers,
	Roman.

-- 
	    Roman Kagan, research scientist, ITEP Lab 201
   B.Cheremushkinskaya 25, 117259 Moscow Russia, tel:+7/095/1259606


More information about the Gcc-bugs mailing list