From owner-freebsd-hackers Sun Nov 2 08:53:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA00262 for hackers-outgoing; Sun, 2 Nov 1997 08:53:49 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from gatekeeper.radio-do.de (gatekeeper.Radio-do.de [193.101.164.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id IAA00257 for ; Sun, 2 Nov 1997 08:53:43 -0800 (PST) (envelope-from fn@gatekeeper.radio-do.de) From: Frank Nobis Message-Id: <199711021655.RAA28154@gatekeeper.radio-do.de> Received: by gatekeeper.radio-do.de (8.8.5/RADIO-1.3(GEN-1.2.16)) via EUnet for freefall.freebsd.org id RAA28154; Sun, 2 Nov 1997 17:55:51 +0100 (MET) Subject: Re: gcc and bitfields In-Reply-To: <199711021618.IAA02063@soda.CSUA.Berkeley.EDU> from John Milford at "Nov 2, 97 08:18:29 am" To: jwm@CSUA.Berkeley.EDU (John Milford) Date: Sun, 2 Nov 1997 17:55:51 +0100 (MET) Cc: kuku@gilberto.physik.rwth-aachen.de, freebsd-hackers@freefall.freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > From: John Milford > 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