struct-init: Support range inits for local vars
Implement missing support for range init for local variables.
This commit is contained in:
@ -148,6 +148,9 @@ void foo (struct W *w, struct pkthdr *phdr_)
|
||||
struct V lv3 = {((struct S){7,8,{9,10}}), ((const struct W *)w)->t.t, 50};
|
||||
const struct pkthdr *phdr = phdr_;
|
||||
struct flowi6 flow = { .daddr = phdr->daddr, .saddr = phdr->saddr };
|
||||
int elt = 0x42;
|
||||
/* Range init, overlapping */
|
||||
struct T lt2 = { { [1 ... 5] = 9, [6 ... 10] = elt, [4 ... 7] = elt+1 }, 1 };
|
||||
print(ls);
|
||||
print(ls2);
|
||||
print(lt);
|
||||
@ -163,6 +166,7 @@ void foo (struct W *w, struct pkthdr *phdr_)
|
||||
print(lv);
|
||||
print(lv2);
|
||||
print(lv3);
|
||||
print(lt2);
|
||||
print(flow);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -33,4 +33,5 @@ ls3: 1 2 3 4
|
||||
lv: 3 4 5 6 68 61 68 61 0 0 0 0 0 0 0 0 0 0 0 0 2d 2e
|
||||
lv2: 1 2 3 4 68 69 68 69 0 0 0 0 0 0 0 0 0 0 0 0 2f 30
|
||||
lv3: 7 8 9 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32
|
||||
lt2: 0 9 9 9 43 43 43 43 42 42 42 0 0 0 0 0 1
|
||||
flow: 9 8 7 6 0 0 0 0 0 0 0 0 0 0 0 0 6 5 4 3 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Reference in New Issue
Block a user