public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Bitfield packing
@ 2002-08-17  2:33 eddy
  2002-08-17 11:58 ` Der Herr Hofrat
  0 siblings, 1 reply; 2+ messages in thread
From: eddy @ 2002-08-17  2:33 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-17 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-17  2:33 Bitfield packing eddy
2002-08-17 11:58 ` Der Herr Hofrat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).