--- Comment #5 from pinskia at gcc dot gnu dot org 2006-09-12 08:01 ---
class A
{
public:
int a[0];
};
This class is not empty, it contains a (GNU) variable sized array so the size
of zero is correct for this extension. The reason why it is zero is because
the array size is ze
--- Comment #4 from jz201115 at zodiac dot mimuw dot edu dot pl 2006-08-24
10:22 ---
Andrew,
So do you want to say this is not a bug? I know the class isn't intersting
but I think it shouldn't have size equal to 0.
Thanks,
Janek
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2882
--- Comment #3 from pluto at agmk dot net 2006-08-23 15:59 ---
(In reply to comment #1)
> (In reply to comment #0)
> >int size1 = sizeof(A); // == 0, should be nonzero
> >int size2 = sizeof(a); // == 0, should be nonzero
>
> What makes you think so?
>
> > Since: ISO 14882-2003,
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-08-23 15:14 ---
First this:
int a[0];
is an extension on top of the C++ standard which means to allocate nothing so
you can use malloc to allocate more than is needed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=288
--- Comment #1 from bangerth at dealii dot org 2006-08-23 15:01 ---
(In reply to comment #0)
>int size1 = sizeof(A); // == 0, should be nonzero
>int size2 = sizeof(a); // == 0, should be nonzero
What makes you think so?
> Since: ISO 14882-2003, 9 [Classes].3
I don't quite kno