From: Muli Ben-Yehuda <mulix@actcom.co.il>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: Re: weird padding in linux/timex.h, struct timex
Date: Tue, 6 Aug 2002 15:52:25 +0300 [thread overview]
Message-ID: <20020806125224.GP29139@alhambra.actcom.co.il> (raw)
In-Reply-To: <1028640964.18130.145.camel@irongate.swansea.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
On Tue, Aug 06, 2002 at 02:36:04PM +0100, Alan Cox wrote:
> 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.
I assume 4 byte ints, because I assume that the length of a 32 bit
bitfield will be 32 bits. As for alignment, you're correct.
I guess my question becomes: is the original code defined in any
special way, in regards to padding and size? If it isn't, my __pad
patch would be cleaner and just as correct in principle. If it is, I
can make a __pad which will behave exactly the same way.
Thanks, Muli.
--
I am PINK, hear me ROAR
http://vipe.technion.ac.il/~mulix/
http://syscalltrack.sf.net/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2002-08-06 12:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-06 11:15 Muli Ben-Yehuda
2002-08-06 13:36 ` Alan Cox
2002-08-06 12:52 ` Muli Ben-Yehuda [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020806125224.GP29139@alhambra.actcom.co.il \
--to=mulix@actcom.co.il \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®