This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
funny problem with g++
- From: Tommy Vercetti <vercetti at zlew dot org>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 7 Dec 2005 16:15:17 +0100
- Subject: funny problem with g++
Hi there
We had funny issue here lately. Someone wanted to create table that
had 0 elements in C++, for instance this code:
int main()
{
char a[0];
char b[0];
a[0] = 1;
b[0] = 2;
return a[0] + b[0];
}
is perfectly ok for g++, it isn't for other compilers.
I would say this should cause fatal error. Even without any -W flags on.
-pedantic works fine, but this should be an error always, not just
when -pedantic is used.
Thanks.
--
TV
"If we knew what we were doing, it wouldn't be called Research, would
it?" - AE