m68k structure packing
Jim Wilson
wilson@cygnus.com
Thu Oct 2 20:01:00 GMT 1997
... 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
More information about the Gcc
mailing list