From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8343 invoked by alias); 17 Aug 2002 09:33:32 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 8336 invoked from network); 17 Aug 2002 09:33:30 -0000 Received: from unknown (HELO independence.universe) (80.134.117.74) by sources.redhat.com with SMTP; 17 Aug 2002 09:33:30 -0000 Received: by independence.universe (Postfix, from userid 1000) id 0285513B84; Sat, 17 Aug 2002 09:33:37 +0200 (CEST) Date: Sat, 17 Aug 2002 02:33:00 -0000 To: gcc-help@gcc.gnu.org Subject: Bitfield packing Message-ID: <20020817073337.GA816@fericom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i From: eddy@fericom.net X-SW-Source: 2002-08/txt/msg00144.txt.bz2 Hi, I am using gcc for a microcontroller application. I want to use bitfields to describe the processor registers, similar to this: typedef union { IO_BYTE byte; struct { IO_BYTE P30 :1; IO_BYTE P31 :1; IO_BYTE P32 :1; IO_BYTE P33 :1; IO_BYTE P34 :1; IO_BYTE P35 :1; IO_BYTE P36 :1; IO_BYTE P37 :1; } bit; } PDR2; How does gcc handle bitfields like thisone? Above I have defined 8 bits, are they distributed on several bytes with some optimization levels? How do I setup gcc, so that it will always assign the bits 1:1 (no packing/optimization)? Thanks Eddy Ilg