boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

00209.c (869B)


      1 /* The following are all valid decls, even though some subtypes
      2    are incomplete.  */
      3 enum E *e;
      4 const enum E *e1;
      5 enum E const *e2;
      6 struct S *s;
      7 const struct S *s1;
      8 struct S const *s2;
      9 
     10 /* Various strangely looking declarators, which are all valid
     11    and have to map to the same numbered typedefs. */
     12 typedef int (*fptr1)();
     13 int f1 (int (), int);
     14 typedef int (*fptr2)(int x);
     15 int f2 (int (int x), int);
     16 typedef int (*fptr3)(int);
     17 int f3 (int (int), int);
     18 typedef int (*fptr4[4])(int);
     19 int f4 (int (*[4])(int), int);
     20 typedef int (*fptr5)(fptr1);
     21 int f5 (int (int()), fptr1);
     22 int f1 (fptr1 fp, int i)
     23 {
     24   return (*fp)(i);
     25 }
     26 int f2 (fptr2 fp, int i)
     27 {
     28   return (*fp)(i);
     29 }
     30 int f3 (fptr3 fp, int i)
     31 {
     32   return (*fp)(i);
     33 }
     34 int f4 (fptr4 fp, int i)
     35 {
     36   return (*fp[i])(i);
     37 }
     38 int f5 (fptr5 fp, fptr1 i)
     39 {
     40   return fp(i);
     41 }
     42 int f8 (int ([4]), int);
     43 int main () { return 0; }