From owner-freebsd-hackers Mon Jan 30 12:33:11 1995 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id MAA09717 for hackers-outgoing; Mon, 30 Jan 1995 12:33:11 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id MAA09708 for ; Mon, 30 Jan 1995 12:32:46 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id HAA09887; Tue, 31 Jan 1995 07:30:22 +1100 Date: Tue, 31 Jan 1995 07:30:22 +1100 From: Bruce Evans Message-Id: <199501302030.HAA09887@godzilla.zeta.org.au> To: jc@irbs.com, mtaylor@gateway.cybernet.com Subject: Re: disable structure packing with gcc? Cc: freebsd-hackers@freefall.cdrom.com Sender: hackers-owner@FreeBSD.org Precedence: bulk >> I'm writing a byte-swapping routine for structures in gcc 2.4.5 (FreeBSD >> 1.1.5.1). gcc insists on packing structures, and I do not fully understand >> the packing method it uses. >> >> How can I turn off structure packing (to get to single byte alignment)? s/packing/padding/. >gcc 2.X supports #pragma pack() directives if it is compiled with >-DHANDLE_SYSV_PRAGMA. I have several cross-compilers with this option >enabled and they DTRT. gcc.2.[4-5] supports __attribute__ ((packed)) declarations in all configurations. This feature is even more unportable than #praga pack. Bruce