lkml.org 
[lkml]   [2007]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ubi: kill homegrown endian macros
Date
>> Out of curiosity, why would a compiler ever insert padding in a 
>> structure
>> that has all its elements properly-aligned?
>
> Well, it might decide it would be nicer if some elements were aligned
> to
> 64 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-19 00:03    [W:0.173 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site