Luca said:
Vincenzo Mercuri wrote:
so it has not sense [...]
sorry, i meant 'it makes no sense'
I agree that it makes no sense, but how one concludes that it is
invalid?
Beware that 'C: A Reference Manual' says that it is
"nonsensical and (in Standard C) illegal" where Standard C
means C89 (see page 4, 5th edition).
Now I can't say if it is illegal in C89, (i dont have the
Standard) but I can just say it is nonsensical in C99
Hi Vincenzo,
I checked C89 and I don't see in it anything that renders such a
declaration invalid. I think it is valid and a well-defined
declaration.
And that it has a meaning, because it declares the new struct type and
its tag.
Because of that, I wouldn't call it nonsensical. The only
"nonsensical" part, is that it uses a storage-class specifier that
could be omitted without changing the declaration's meaning. There are
cases like this. For instance in
extern int f(void);
the storage-class specifier could be omitted without changing
semantics, as well (so I think).
Would you call it nonsensical, too ?