From owner-freebsd-hackers Fri Sep 14 5: 3:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [24.14.150.180]) by hub.freebsd.org (Postfix) with ESMTP id 8D1D537B405; Fri, 14 Sep 2001 05:03:20 -0700 (PDT) Received: from overcee.netplex.com.au (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f8EC3KM78670; Fri, 14 Sep 2001 05:03:20 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 25BB5380A; Fri, 14 Sep 2001 05:03:20 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: tlambert2@mindspring.com Cc: Mike Smith , Yar Tikhiy , hackers@FreeBSD.ORG, msmith@mass.dis.org Subject: Re: Driver structures & alignment In-Reply-To: <3BA1C819.65D72D4B@mindspring.com> Date: Fri, 14 Sep 2001 05:03:20 -0700 From: Peter Wemm Message-Id: <20010914120320.25BB5380A@overcee.netplex.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Terry Lambert wrote: > Mike Smith wrote: > > Having said that, I recommend using __attribute__ ((packed)) > > to explicitly request that a structure be packed. > > Is there a problem with "#pragma pack(1)"? I see it in a > lot of header files... do they need changing? Yes, but it should be: #define __packed __attribute__((packed)) in sys/cdefs.h. This allows us to provide an alternative __packed implementation for some other mythical compiler some day. The same goes for __format_arg(n) in stdio.h. And so on. We've been pretty clean about it so far, but a few have slipped through. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message