diff options
| author | 2023-05-29 11:37:32 +0200 | |
|---|---|---|
| committer | 2023-05-29 11:37:32 +0200 | |
| commit | 1c04435e5d33378ffa8eca65ca1ed35f3f9f4134 (patch) | |
| tree | eab923f7dde10ba1d71d8efe025891e743009203 /test.c | |
| parent | 84824a0ed3a0cf90728078b74ca39778c51e60b9 (diff) | |
field access
Diffstat (limited to 'test.c')
| -rw-r--r-- | test.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -13,7 +13,31 @@ int add (int x, int y) { return x + y + *glob; } -struct foo {struct foo *foo;}; +struct foo { + struct foo *foo; + struct n0 { + char z; + struct n1 { + char q; + struct n2 { + int ww; + } n2; + } n1; + } n0; + union { + struct { short x, y; }; + int xy; + }; + char flex[]; +}; + +int foop(struct foo *foo) { + if (foo->foo) foo = foo->foo; + ++foo->n0.n1.n2.ww; + int xy = (*foo).xy; + foo->flex[2] *= 5; + if (foo->x)return xy; else return foo->y; +} int abs(int x){ return (x ^ x >> 3\ |