Struct definition in MS-C

Carl Paukstis carlp at frigg.iscs.com
Tue Aug 22 06:16:17 AEST 1989


In article <Aug.16.14.48.38.1989.11505 at caip.rutgers.edu> shuang at caip.rutgers.edu (Shuang Chen) writes:
>I am trying to use struct to implement a linked list with Microsoft C.
>typedef struct {
>	...
>	node *next;
>	} node;
>
>Actually I tried to use
>
>struct node {
>	...
>	struct node *next;
>	};
>as it is with standard C, but this doesn't work with MS-C.

Chen doesn't mention which version of MSC - both of the above constructs
work just fine with v5.10, even in "W3" (bitchy) warning mode they
(properly) don't generate any messages whatsoever.

However, I can see how MS could have implemented a version which choked
on the first construct but compiled the second OK.  I'm certainly no
compiler guru, but it seems to me that the second example gives the
compiler some needed information sooner.

Would things improve if we changed the first example to start with
  typedef struct node {...
?

--
Carl Paukstis       "I'm the NRA"         |  DOMAIN:   carlp at iscuva.ISCS.COM   
    <political message goes here>         |  UUCP:     ...uunet!iscuva!carlp  
                                          |  GEnie: carlp         BIX: carlp
I speak for myself, not my employer.      |  Ma Bell:  +1 509 927 5439



More information about the Comp.lang.c mailing list