lkml.org 
[lkml]   [2002]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: weird padding in linux/timex.h, struct timex
From
Date
On Tue, 2002-08-06 at 12:15, Muli Ben-Yehuda wrote:
> Hi,
>
> struct timex in include/linux/timex.h is defined as
>
> struct timex
> {
> ...
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> int :32; int :32; int :32; int :32;
> };
>
> I assume that this is used as padding. Is there any reason for using
> bitfields as padding? If there is, a comment to that effect would be
> nice. If there isn't, the following patch makes the padding explicit.
>

That is how the interface has always been defined. I think we inherited
that from the world of xntpd but I may be wrong. Your __pad is not
always the same thing - you assume 4 byte ints and ints aligned the same
way as char [], which may not always be true.


-
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: 2005-03-22 13:27    [W:0.055 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site