public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Mark Mitchell <mark@codesourcery.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: C ABI: struct/union inconsistency
Date: Fri, 27 Sep 2002 09:33:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.33.0209271715380.29516-100000@kern.srcf.societies.cam.ac.uk> (raw)
In-Reply-To: <200209252358.g8PNwBG01380@localhost.localdomain>

On Wed, 25 Sep 2002, Mark Mitchell wrote:

> Accepting empty structures in C is an extension, but structures like S
> (i.e., with a single zero-width bitfield) are part of the language.

They are not; a structure with no named members is undefined behavior
(6.7.2.1#7), and a zero-width bit-field may not be named (6.7.2.1#3).

> might be.  I also do not know if some piece of code in the Linux
> kernel is going to depend on the current behavior; we might want to
> have a switch for the old behavior.

Linux uses size 0 empty structures for efficiency (types that only need be
nonempty in SMP kernels), but only with sufficiently recent GCC; with
older GCC nonempty dummy structures are used because of compiler bugs.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

  reply	other threads:[~2002-09-27 16:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-27  8:59 Mark Mitchell
2002-09-27  9:33 ` Joseph S. Myers [this message]
2002-09-27 10:09 ` Richard Henderson
2002-09-27 10:31   ` Mark Mitchell
2002-09-27 11:41     ` Richard Henderson
2002-09-27 11:54       ` Gabriel Dos Reis
2002-09-27 13:44         ` Mark Mitchell
2002-09-27 15:11           ` Richard Henderson
2002-09-27 15:18             ` Mark Mitchell
2002-09-27 16:26               ` Richard Henderson
2002-09-27 17:53                 ` Mark Mitchell
2002-09-27 18:51                   ` David S. Miller
2002-09-27 19:01                     ` Mark Mitchell
2002-09-27 19:54                       ` Richard Henderson
2002-09-28 10:38                         ` Tim Hollebeek
2002-09-28 12:56                           ` Mark Mitchell
2002-09-28 13:00                             ` Richard Henderson
2002-09-28 13:52                               ` Mark Mitchell
2002-09-30  9:20                                 ` Gabriel Paubert
2002-09-30 10:22                                   ` Gabriel Dos Reis
2002-09-28 16:55                               ` Per Bothner
2002-09-29  2:40                                 ` Tim Hollebeek
2002-09-27 20:02                       ` Michael S. Zick
2002-09-28  9:01                       ` Fergus Henderson
2002-09-27 20:43                     ` Hans-Peter Nilsson
2002-09-28 16:55                     ` Alexandre Oliva
2002-09-28  7:02 Robert Dewar

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=Pine.LNX.4.33.0209271715380.29516-100000@kern.srcf.societies.cam.ac.uk \
    --to=jsm28@cam.ac.uk \
    --cc=gcc@gcc.gnu.org \
    --cc=mark@codesourcery.com \
    /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).