How to stop gcc padding structs???

Grant Edwards grante@visi.com
Mon Jan 29 10:25:00 GMT 2001


On Mon, Jan 29, 2001 at 01:13:52PM -0500, Michael Meissner wrote:

> Well there is the original Alpha, which had to use hacks to get
> around the problem of not having byte/16-bit access
> instructions at the device layer (and multiple instructions to
> pack/unpack the values).
> 
> What I thought you meant was something like:
> 
> 	int i = *(int *)((char *p) + 14);
> 
> Ie, unaligned word access (the x86 always allows unaligned
> accesses albeit at a performance penalty, as do the high-end
> powerpc's in big endian mode).

Yup. I ran into the unalinged word problem years ago on a SPARC
processor.  I don't know if the newer SPARCs allows unalinged
words or not.

-- 
Grant Edwards
grante@visi.com


More information about the Gcc mailing list