You cannot decide how to handle this without knowing how it is used. If this is just used to save space, you can ignore it and just use a struct.
However, this usually does not mean that alliances are used. There are two general reasons for using them. One of them is to provide two or more ways to access the same data. For example, combining an int and an array of 4 bytes is one (of many) ways to extract bytes from a 32-bit integer.
Another is when the data in the structure comes from an external source, such as a network data packet. Typically, one element of a structure that spans a pool is an identifier that tells you which flavor of the pool is in effect.
In any of these cases, you cannot blindly ignore the union and transform it into a structure where two (or more) fields do not match.
Steve Fallows Sep 24 '08 at 15:37 2008-09-24 15:37
source share