34
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 10 Nov 2025
34 points (75.8% liked)
Linux
57274 readers
1009 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
You mean 'unnamed' is what's confusing you?
Normally you can do anonymous struct/union members or struct struct/union members that are tagged structs but not anonymous.
I.e. in standard C you'd have to do either:
or:
but to do the following, you'd need the extension:
~~Minor correction: Unnamed structs and unions (so your second example) are not part of C. They are GNU extensions.~~
"ANSI C" by Kernighan and Ritchie disagrees , including that syntax (note : retranslation from Polish as that's the language my copy is in) :
Yes, but I was talking about field name, not struct tag. And up to C99 my comment was correct.
Unless I'm misunderstanding something, I'm pretty sure they've been standardized in C11. Also mentioned here.
You appear to be correct.