I am converting a vxWorks application to Linux.
Previously, I had a union
with a word
and a struct
so that when I accessed the members of the struct
, I could use the word's
layout to build my struct
members.
However, I don't recall how I figured this out and it works on the vxWorks box. On my vxWorks instance, the layout is:
typedef union Status
{
struct fields
{
uint32_t byteA : 1; // <31>
uint32_t blank : 23; // <30:8>
uint32_t bytesN : 8; // <7:0>
} fields;
uint32_t word;
}
I've already ran into some endian issues while porting from vxWorks to Linux. So figuring out the layout of uint32_t
on linux is important.