S
Steven Woody
hi,
i get a struct as below,
typedef struct
{
uint16_t id;
long offset;
} foo_t;
foo_t foo;
somewhere in the code, i need the address of the 'id' member, so i get
it using "& foo.id". this has no problem with GNU C compiler, but with
another compile (IAR C), i got an warning,
"warning use of address of unaligned structure member"
so i want to ask, why using address of an unaligned structure memeber
was considered as a fault. and how do i elimited it?
thanks.
-
woody
i get a struct as below,
typedef struct
{
uint16_t id;
long offset;
} foo_t;
foo_t foo;
somewhere in the code, i need the address of the 'id' member, so i get
it using "& foo.id". this has no problem with GNU C compiler, but with
another compile (IAR C), i got an warning,
"warning use of address of unaligned structure member"
so i want to ask, why using address of an unaligned structure memeber
was considered as a fault. and how do i elimited it?
thanks.
-
woody