C51 COMPILER V7.04 Follow code genearated is bad:
code struct { int i; union { char a; int b; } u; } test_array[][10] = { { {0, {0}}, } }; code char TESTCODE[] = {12,24,36,42}; TESTCODE has bad allocation. WATCH window: 'test_array | C:00x6E [] "" 'TESTCODE | C:00x6E [ ... ] This bug removed when array with specifed size: ... test_array[1][10] ...
The example posted doesn't do anything with either of those variables. In that case there's nothing particularly wrong with the compiler overlaying the two. Make sure your actual test code not only defines, but also uses those objects.