git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Spell __attribute__ correctly in cache.h.

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 28, 2005, 19:48 UTC
Message-ID
<Pine.LNX.4.58.0508281245150.3317@g5.osdl.org>
In-Reply-To
<43120BC5.8060608@kaijanaho.info>
On Sun, 28 Aug 2005, Antti-Juhani Kaijanaho wrote:
Show 5 quoted lines
> 
> This is not true under C99.  If an array[] is the last member of a
> struct (which is what we are, AFAIK, talking about), then sizeof that
> struct is defined and gives the size of that struct as if the array's
> size were zero (but the struct cannot be used in an automatic context).

Ahh, thanks. Mea culpa, I thought it was illegal in general. In that case, the only reason not to use [] is that older gcc's don't like it, but even that version cut-off may be old enough to not matter.

Anybody know? gcc-2.95 is still considered production at least for the kernel. I don't have it available to test whether it understands [] though.

		Linus
Previous: Antti-Juhani KaijanahoNext: Martijn Kuipers
Message 10 of 13 in “Spell __attribute__ correctly in cache.h.”
  1. Spell __attribute__ correctly in cache.h.Jason Riedy, Aug 19, 2005
  2. Junio C HamanoAug 19, 2005
  3. Jason RiedyAug 19, 2005
  4. Junio C HamanoAug 19, 2005
  5. Jason RiedyAug 23, 2005
  6. Junio C HamanoAug 28, 2005
  7. Jason RiedyAug 28, 2005
  8. Linus TorvaldsAug 28, 2005
  9. Antti-Juhani KaijanahoAug 28, 2005
  10. Linus TorvaldsAug 28, 2005
  11. Martijn KuipersAug 29, 2005
  12. Antti-Juhani KaijanahoAug 29, 2005
  13. Martijn KuipersAug 29, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.