H
Heikki Kallasjoki
I think you may be mistaken on that last point.
Are you saying that (with such an extension), this:
union {
unsigned u;
float f;
};
f = 1.0;
printf("0x%x\n", u);
would be allowed? I haven't seen that; gcc warns "unnamed
struct/union that defines no instances". In other words, a
standalone anonymous union is already valid but useless.
At least from C99 onwards, I don't think it's "already valid"; based on
the constraint in C99 6.7p2:
A declaration shall declare at least a declarator (other than the
parameters of a function or the members of a structure or union), a
tag, or the members of an enumeration.
It would therefore be a non-conflicting extension to assign some
compiler-specific meaning on such code. (Though I have not come across
such an extension anywhere either.)