[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] struct align



"Miro Kropacek" <miro.kropacek@gmail.com> writes:

> You see -- the 3rd member is put xxxxxC address (i.e. divisible by 4), fine.
> But now, on both atari compilers is then 'long' member aligned on 2 bytes
> (xxxxE, which is 14 for x = 0, i.e. divisible only by 2) what I find wrong
> since it should work according to the data type (char = aligned on 1 byte
> boundary, short = 2 bytes, long = 4 bytes, ...) and this assumption supports
> the fact it works in that way on linux's gcc. But I have no idea, what's
> wrong here? linker setup or gcc setup?

There is nothing wrong here.  Alignment is part of the ABI, and
architecture dependent.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."