scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

0159-typedef.c (276B)


      1 /* Taken from plan9 kernel */
      2 
      3 typedef struct Clock0link Clock0link;
      4 typedef struct Clock0link {
      5 	int             (*clock)(void);
      6 	Clock0link*     link;
      7 } Clock0link;
      8 
      9 
     10 int
     11 f(void)
     12 {
     13 	return 0;
     14 }
     15 
     16 Clock0link cl0 = {
     17 	.clock = f;
     18 };
     19 
     20 int
     21 main(void)
     22 {
     23 	return (*cl0.clock)();
     24 }