should "char T[0];" compile?

Johan Huylebroeck johan@easics.be
Thu Aug 12 07:02:00 GMT 1999


I think I found a bug(didn't find it in the known bug section) in gcc
ver 2.95 compiled for solaris (sparc) or else I misinterpret the c++
standard (8.3.4) that says that size of array should be greater than
zero.


This program should not compile:

int main(void){
   char T[0];    //  <- array size should be positive > 0 (C++ std
8.3.4)
   T[0] = 1;
   return T[0];
} ;

the full output of  "gcc -v --save-temps -Wall cta.cpp" are in the
attachement



More information about the Gcc-bugs mailing list