This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: m68k structure packing


	... 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]