Out of curiosity, why would a compiler ever insert padding in a structurethat has all its elements properly-aligned?Well, it might decide it would be nicer if some elements were aligned to64 bits. Or to a cache line. Or something. I don't care about _why_ -- the point is that it's _allowed_ to. Hence the original use of __attribute__((packed)).
It's not the compiler who decides -- struct layout is dictated by the ABI you're compiling for. Segher - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] ubi: kill homegrown endian macros
- From: David Woodhouse <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- References:
- [PATCH] ubi: kill homegrown endian macros
- From: Christoph Hellwig <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: Artem Bityutskiy <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: Christoph Hellwig <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: Artem Bityutskiy <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: Andrew Morton <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: Matthieu CASTET <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: David Woodhouse <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: "John Anthony Kazos Jr." <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: David Woodhouse <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: "John Anthony Kazos Jr." <[email protected]>
- Re: [PATCH] ubi: kill homegrown endian macros
- From: David Woodhouse <[email protected]>
- [PATCH] ubi: kill homegrown endian macros
- Prev by Date: Re: 2.6.22-rc1 killed my ext3 filesystem cleanly unmounted
- Next by Date: [BUG] acpi double resume and fail
- Previous by thread: Re: [PATCH] ubi: kill homegrown endian macros
- Next by thread: Re: [PATCH] ubi: kill homegrown endian macros
- Index(es):