Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 1997 17:55:51 +0100 (MET)
From:      Frank Nobis <fn@gatekeeper.radio-do.de>
To:        jwm@CSUA.Berkeley.EDU (John Milford)
Cc:        kuku@gilberto.physik.rwth-aachen.de, freebsd-hackers@freefall.freebsd.org
Subject:   Re: gcc and bitfields
Message-ID:  <199711021655.RAA28154@gatekeeper.radio-do.de>
In-Reply-To: <199711021618.IAA02063@soda.CSUA.Berkeley.EDU> from John Milford at "Nov 2, 97 08:18:29 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> From: John Milford <jwm@CSUA.Berkeley.EDU>

> By default gcc pads structures to make make the size a multiple of 4 bytes.
> Try:
> 
>    struct C_OPEN {
>       int a;
> 	int b;
> 	unsigned xdt:1;
> 	unsigned reserved:15;
>    } __attribute__ ((packed));
> 
Make it unsigned short too, then it will work out with a size of 10.

-- 
 Frank Nobis                            Email: PGP AVAILABLE
 Landgrafenstr. 130                     dg3dcn   http://www.radio-do.de/~fn/
 44139 Dortmund     Powered by FreeBSD  Fax: +49 231 7213816




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711021655.RAA28154>