From: Wolfgang Denk <wd@denx.de>
To: Bret Indrelee <Bret.Indrelee@qlogic.com>
Cc: Kent Borg <kentborg@borg.org>, linuxppc-embedded@lists.linuxppc.org
Subject: Re: IO, ANSI vs GCC structs
Date: Fri, 25 Jul 2003 18:19:35 +0200 [thread overview]
Message-ID: <20030725161940.41FDEC602D@atlas.denx.de> (raw)
In-Reply-To: Your message of "Fri, 25 Jul 2003 10:51:19 CDT." <Pine.LNX.4.44.0307251038370.22864-100000@spider.ancor.com>
In message <Pine.LNX.4.44.0307251038370.22864-100000@spider.ancor.com> you wrote:
>
> > Does GCC make guarantees beyond what ANSI requires? Is there some
> > subtle detail that forces struct layout ("volatile" in the definition
> > perhaps)?
>
> There is nothing that guarentees this, in ANSI or GCC.
You can use "__attribute__ ((packed))" with GCC which guaratees you
control over the alignment used by the compiler (it will use the
smallest possible alignment = one byte for a variable, and one bit
for a field, unless you specify a larger value with the `aligned'
attribute).
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd@denx.de
The human race has one really effective weapon, and that is laughter.
- Mark Twain
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2003-07-25 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-25 15:30 IO, ANSI vs GCC structs Kent Borg
2003-07-25 15:51 ` Bret Indrelee
2003-07-25 16:19 ` Wolfgang Denk [this message]
2003-07-25 17:47 ` Kent Borg
2003-07-25 19:22 ` Wolfgang Denk
2003-07-25 21:45 ` Paul Mackerras
[not found] <5.1.0.14.2.20030725123123.03855f58@mail.ebshome.net>
2003-07-25 19:59 ` Bret Indrelee
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=20030725161940.41FDEC602D@atlas.denx.de \
--to=wd@denx.de \
--cc=Bret.Indrelee@qlogic.com \
--cc=kentborg@borg.org \
--cc=linuxppc-embedded@lists.linuxppc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.