Afficher un message
Vieux 18/10/2007, 05h36   #8
ymuntyan@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: What's the use of anonymous structs?

On Oct 17, 5:34 pm, Eric Sosman <esos...@ieee-dot-org.invalid> wrote:
> Fred Phillips wrote:
> > On 17 Oct 2007 at 21:45, Richard Heathfield wrote:
> >> Fred Phillips said:

>
> >>> Title says ["What's the use of anonymous structs?"]
> >> As far as I can discern, C doesn't provide such a feature. So the
> >> answer is "none, as far as C is concerned". If your implementation
> >> provides such a feature as an extension, consult its documentation to
> >> find out why.

>
> >> As a rule, "What's the use of..." questions are pretty pointless. If
> >> you can't think of a use for something, don't use it.

>
> > Sorry, I guess I wasn't clear. I mean things like
> > struct { int a; int b; } c;
> > which is certainly valid C. However, this anonymous struct doesn't seem
> > to be compatible with any other anonymous struct of the same signature.
> > [...]

>
> It's compatible with an identically-declared struct in
> a different module ...


Doesn't this contradict 6.7.2.3p4?

Best regards,
Yevgen

  Réponse avec citation
 
Page generated in 0,04711 seconds with 9 queries