On Jun 12, 1:16 pm, Harald van D©¦k <true...@gmail. comwrote:
On Thu, 12 Jun 2008 09:13:27 -0700, JoseMariaSola wrote:
>
>
>
>
It's a constraint violation, which requires a diagnostic from any
conforming implementation.
>
>
If you asked it to try to conform to the standard, then yes.
>
>
It's in 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." Your declaration does not
declare any of those.
The following declaration is valid:
struct {int x;};
No, it isn't. It's not a syntax error, but C requires a declaration to
actually declare something.
actually declare something.
Is it a static semantic error?
It's a constraint violation, which requires a diagnostic from any
conforming implementation.
>
My compiler doesn't detect it. Is it
broken?
broken?
If you asked it to try to conform to the standard, then yes.
>
In the Standard I didn't find any restriction.
It's in 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." Your declaration does not
declare any of those.
Leave a comment: