Subject: Re: Question regarding the array of size 0.
To: John Franklin <franklin@elfie.org>
From: Johan Danielsson <joda@pdc.kth.se>
List: tech-kern
Date: 03/20/2001 20:28:05
John Franklin <franklin@elfie.org> writes:
> > Not in C.
>
> Actually you can (see below).
No you can't. This is from C99:
6.7.5.2 Array declarators
Constraints
In addition to optional type qualifiers and the keyword static, the [
and ] may delimit an expression or *. If they delimit an expression
(which specifies the size of an array), the expression shall have an
integer type. If the expression is a constant expression, it shall
have a value greater than zero. [...]
> What follows was done on a NetBSD 1.5 system.
Which uses gcc.
I think they use a similar example in the spec, but with an array size
of one.
/Johan