Skip site navigation (1)Skip section navigation (2)
Date:      05 Aug 2002 11:28:47 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.no-ip.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: GCC versions!!!
Message-ID:  <44fzxttjdc.fsf@be-well.ilk.org>
In-Reply-To: <20020805080917.GB15513@happy-idiot-talk.infracaninophi>
References:  <3D386AED1B47D411A94300508B11F18704AD6999@fmsmsx116.fm.intel.com> <20020805080917.GB15513@happy-idiot-talk.infracaninophi>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Seaman <m.seaman@infracaninophile.co.uk> writes:

> I doubt there's a difference at this level between gcc on Linux or
> FreeBSD: this sort of alignment/endianness issue is mostly a function
> of the CPU the code is running on.  At a guess, your second result was
> obtained on a Sparc or PowerPC[*] or similar CPU, which is the
> other-endian from an x86 class CPU: I never can rememder which one is
> 'big-endian' and which one is 'little-endian' though.

X86 are little-endian; among other processors, big-endian is somewhat
more common.  Note that the compiler is perfectly within its rights to
add padding at any point in the structure, so this code invokes
implementation-defined behaviour in any case.  [You ignore the
compiler warning messages "assignment from incompatible pointer type"
at your peril.]

Be well.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44fzxttjdc.fsf>