scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0092-fptr.c (213B)


      1 int
      2 zero()
      3 {
      4 	return 0;
      5 }
      6 
      7 struct S
      8 {
      9 	int (*zerofunc)();
     10 } s = { &zero };
     11 
     12 struct S *
     13 anon()
     14 {
     15 	return &s;
     16 }
     17 
     18 typedef struct S * (*fty)();
     19 
     20 fty
     21 go()
     22 {
     23 	return &anon;
     24 }
     25 
     26 int
     27 main()
     28 {
     29 	return go()()->zerofunc();
     30 }