boot2

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

054-init-struct-desig.c (291B)


      1 // tests/cc-parse/54-init-struct-desig.c — designated struct init. §E.6.
      2 //
      3 // Read field b through pointer arithmetic; member-access codegen is
      4 // owned elsewhere (§D).
      5 struct S { int a; int b; };
      6 struct S s = { .b = 7 };
      7 int main(void) {
      8     int *p = (int *)&s;
      9     return *(p + 1);
     10 }