6.5.6 :
8 - [...] , , , . [...] , *, .
malloc, :
7.22.3
1 - [...] , , , ( ). .
, , , MyStruct, , . (6.7.2.1:18).
, J.2 Undefined :
1 - Undefined : [...]
- , .
- , *, .
- , , -, ( lvalue a[1][7] int
a[4][5]).
, , Undefined :
MyStruct *foo = malloc(sizeof(MyStruct) + sizeof(int) * 10);
foo->data[5] = 1;
:
MyStruct *foo = malloc(sizeof(MyStruct) + sizeof(int) * 10);
((int *) foo)[(offsetof(MyStruct, data) / sizeof(int)) + 5] = 1;
++ ; 3.9.2 [basic.compound] :
3 - [...] T A, cv T*, A, , , , .
C , . restrict.