I've found a code for microcontroller with a strange nesting of structures and union.
What is the purpose or optimizations of this kind of structure:
struct sExtTable {
... data
struct {
... data
union {
struct {
... data
} intUnionStruct;
struct {
... data
} intUnionStruct2;
} union;
} intStruct;
} ExtTable;
I access this data as ExtTable.intStruct.union.intUnionStruct.data . Why a union instead leaving the two struct (intUnionStruct1 and intUnionStruct2) inside intStruct ?
Is there some kind of memory optimization?
I'm sorry to not be able to load code since is not public.