From owner-freebsd-hackers Sun Nov 2 07:16:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA26392 for hackers-outgoing; Sun, 2 Nov 1997 07:16:25 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from Campino.Informatik.RWTH-Aachen.DE (campino.Informatik.RWTH-Aachen.DE [137.226.116.240]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA26387 for ; Sun, 2 Nov 1997 07:16:22 -0800 (PST) (envelope-from kuku@gilberto.physik.RWTH-Aachen.DE) Received: from gil.physik.rwth-aachen.de (gilberto.physik.rwth-aachen.de [137.226.30.2]) by Campino.Informatik.RWTH-Aachen.DE (8.8.7/RBI-Z14) with ESMTP id QAA22018 for ; Sun, 2 Nov 1997 16:16:19 +0100 (MET) Received: (from kuku@localhost) by gil.physik.rwth-aachen.de (8.8.5/8.6.9) id QAA04864 for freebsd-hackers@freefall.cdrom.com; Sun, 2 Nov 1997 16:31:07 +0100 (MET) Date: Sun, 2 Nov 1997 16:31:07 +0100 (MET) From: Christoph Kukulies Message-Id: <199711021531.QAA04864@gil.physik.rwth-aachen.de> To: freebsd-hackers@freefall.FreeBSD.org Subject: gcc and bitfields Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk During porting a piece of a DOS program to make a driver for FreeBSD of it for a certain device I'm stuck at the point where there is a structure: struct C_OPEN { int a; int b; unsigned xdt:1; unsigned reserved:15; } The sizeof this structure is 10 under DOS (borland C) and evaluates to 12 under cc (gcc) on FreeBSD. There are a lot of these definitions and it would be tedious to find a workaround. Does anyone know if I can pack the structure respectively enforce the bitfield to a short int? -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de