On 8/5/05, Amit Dang <[EMAIL PROTECTED]> wrote:
> Hi Steve,
>    Thanks for your prompt response and the valuable information. But I
> tried following on Linux 32-bit gcc 2.96
> struct temp {
>    long long i;
>    char c;
> } and sizeof(struct temp) gave 12 not 16.

Hmm, I have no access to a 32-bit machine right now, but I am running
GCC 3.4.2 on SPARC and sizeof(temp) gives 16 as expected.

One thing a could think of is that on 32-bit machines it makes no
sense to pad to 16 bytes since the natural word size (size of internal
registers) is 4 bytes resulting in an unnecessary read operation to
fetch the rest of the structure that is useless anyway.

Regards

        \Steve

PS: I am going to investigate this issue when I return to my lab and
will mail you the results privately if you don't mind.

--

Steve Graegert <[EMAIL PROTECTED]>
Software Consultancy {C/C++ && Java && .NET}
Mobile: +49 (176)  21248869
Office: +49 (9131) 7126409
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to