Unions are often used by clever programmers to create job security and non-portable programs. I've never actually had a good reason to use them in embedded systems. I've seen some arguments about this here, but never a good reason to use them. The only semi-valid thing I've seen is as a non-portable way to extract the high and low bytes on an int, but there are other ways to do that that probably don't use any more memory so I have my doubts.
Any valid reason to use unions with embedded systems?
Okay, saw the light and wrote some instructional code located at:
to prove the point about the usefulness of unions in packets with variable data types.