7 typedef struct ABC
{ uint16_t aa
, bb
, cc
; } ABC
;
9 char __xdata buf
[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
10 ABC __xdata Abc
= { 0x1111, 0x2222, 0x3333 };
12 void testBug2133(void)
14 ASSERT ( *(char*)&((*(ABC
*) buf
).cc
) == 5); // no errors or warnings; this changes to __data pointer
15 ASSERT ( *(char*)&((*(ABC
*)&buf
).cc
) == 5); // sub-optimal code but okay
16 ASSERT ( *(char*)&(((ABC
*) buf
)->cc
) == 5); // uses generic pointer, otherwise okay
17 ASSERT ( *(char*)&(((ABC
*)&buf
)->cc
) == 5); // same sub-optimal code but okay