This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]