This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: m68k structure packing
- To: mrs at wrs dot com (Mike Stump)
- Subject: Re: m68k structure packing
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Thu, 02 Oct 1997 20:00:41 -0700
- cc: pbarada at wavemark dot com, egcs at cygnus dot com
... code that sets a pointer to the address of an unaligned packed
structure member...
Should the above code fail at runtime?
Yes, it should fail, because the address is not valid for its type.
Someday, we will be able to say something like:
short *ip __attribute__ ((unaligned));
and then it will work, because gcc will know that it needs to emit special
code to derefence the pointer. Meanwhile, you can't expect it to work
portably.
Jim