Re: [PATCH] Spell __attribute__ correctly in cache.h.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Aug 28, 2005, 17:46 UTC
- Message-ID
- <Pine.LNX.4.58.0508281045060.3317@g5.osdl.org>
- In-Reply-To
- <19723.1125249085@lotus.CS.Berkeley.EDU>
On Sun, 28 Aug 2005, Jason Riedy wrote:
Show 6 quoted lines
> > I'm fine with requiring a limited C99 compiler. A > pedantic compiler will reject members with a length > of zero. 6.7.5.2 para1 requires a value greater than > zero for a constant array size. So the code now (with > [0] decls) is neither C89 nor C99.
But using "array[]" means that "sizeof()" no longer works, and then you have to use "offsetof()", which is a big pain.
I think all relevant compilers end up accepting [0] (probably giving a warning, especially in some pedantic mode), since it's been how gcc users have been doing things for years (gcc was late to the [] syntax).
Linus