anonymous structs and unions : legal?
Quote:
> For an interesting example of anonymous structs in C, see
> http://plan9.bell-labs.com/sys/doc/comp.html under the heading
"Extensions" and
> http://plan9.bell-labs.com/sys/doc/compiler.html, section 3.3.
Thanks. that was the usage I had in mind, where you might say,
struct {
int some_flag;
char* some_string;
union {
struct {
float foo;
float bar;
}
struct {
int blivit;
int limpit;
};
};
Quote:
} trashy_example;
I've occasionally run into this, and have to go in and assign names to keep
gcc happy. I'd always assumed it was an extension. In a way, it is a nice
feature if you really don't have
a meaningful name for the internals.