From: eddy@fericom.net
To: gcc-help@gcc.gnu.org
Subject: Bitfield packing
Date: Sat, 17 Aug 2002 02:33:00 -0000 [thread overview]
Message-ID: <20020817073337.GA816@fericom.net> (raw)
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
next reply other threads:[~2002-08-17 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-17 2:33 eddy [this message]
2002-08-17 11:58 ` Der Herr Hofrat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020817073337.GA816@fericom.net \
--to=eddy@fericom.net \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).