This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Zero-length arrays
On Thu, Jan 04, 2001 at 10:37:44AM -0800, Linus Torvalds wrote:
> (I never understood why C had that silly "you can't have a zero-length
> array" rule. Even if there were no real reasons to use them, it still
> has a clear and unambiguous conceptual meaning)
Mostly because they are petrified of objects with zero length, I think.
Not without reason -- they can cause much pain. I havn't thought about
all the ways things can fail, but have run into a couple in playing
around. None serious enough that I thought it absolutely necessary that
we restrict zero-length arrays to otherwise non-empty structures, but
nevertheless the stance gcc is going to have to take in such edge cases
is Don't Do That.
r~