Annotation of researchv10no/cmd/lcc/tst/fields.c, revision 1.1.1.1

1.1       root        1: struct foo {
                      2:        int a;
                      3:        char b;
                      4:        int x : 12, y : 4, : 0, : 4, z : 3;
                      5:        char c;
                      6: } x = { 1, 2, 3, 4, 5, 6 };
                      7: int i = 16;
                      8: struct baz { unsigned int a:2, b:4, c:32;} y = { 7, 8, 9};
                      9: 
                     10: main()
                     11: {
                     12:        printf("x = %d %d %d %d %d %d\n", x.a, x.b, x.x, x.y, x.z, x.c);
                     13:        printf("y = %d %d %d\n", y.a, y.b, y.c);
                     14:        x.y = i;
                     15:        x.z = 070;
                     16:        printf("x = %d %d %d %d %d %d\n", x.a, x.b, x.x, x.y, x.z, x.c);
                     17:        y.a = 2;
                     18:        y.c = i;
                     19:        printf("y = %d %d %d\n", y.a, y.b, y.c);
                     20:        f2(&x);
                     21: }
                     22: 
                     23: f1(struct baz *p) {
                     24:        p->a = p->b = 0;
                     25:        if (p->b)
                     26:                printf("p->b != 0!\n");
                     27:        p->a = 0x3; p->b = 0xf;
                     28:        printf("p->a = 0x%x, p->b = 0x%x\n", p->a, p->b);
                     29: }
                     30: f2(struct baz *p) {
                     31:        p->a = (i==0);
                     32:        p->b = (f1(p),0);
                     33: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.