From mint-bounce@lists.fishpool.fi  Sun Jan 11 11:56:10 2009
From: Andreas Schwab <schwab@suse.de>
To: "Miro Kropacek" <miro.kropacek@gmail.com>
Cc: "Mint list" <mint@fishpool.com>
Subject: Re: [MiNT] struct align
References: <c6533ef60901110727if84153fx4c719c35880b28b2@mail.gmail.com>
X-Yow: - if it GLISTENS, gobble it!!
Date: Sun, 11 Jan 2009 17:29:26 +0100
In-Reply-To: <c6533ef60901110727if84153fx4c719c35880b28b2@mail.gmail.com>
	(Miro Kropacek's message of "Sun, 11 Jan 2009 16:27:11 +0100")
Message-ID: <jey6xhhkm1.fsf@peirce.suse.de>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: schwab@suse.de
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id n0BGu9QA026366

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


