mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Paul Mackerras <paulus@samba.org>, linux-kernel@vger.kernel.org
Subject: Re: __user annotations
Date: Sat, 7 Jun 2003 12:49:36 -0400	[thread overview]
Message-ID: <20030607164936.GA18862@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0306061738200.31112-100000@home.transmeta.com>

On Fri, Jun 06, 2003 at 05:43:58PM -0700, Linus Torvalds wrote:
> 
> On Sat, 7 Jun 2003, Paul Mackerras wrote:
> > Linus Torvalds writes:
> > 
> > > You can get check from
> > > 
> > > 	bk://kernel.bkbits.net/torvalds/sparse
> > 
> > Is that up to date?  I cloned that repository and said "make" and got
> > heaps of compile errors.  First there were a heap of warnings like
> > this:
> 
> You need to have a modern compiler. The "heaps of errors" is what you get 
> if you use a stone-age compiler that doesn't support anonymous structure 
> and union members or other C99 features.
> 
> Gcc has supported them since some pre-3.x version (which is pretty late,
> since they've been around in other compilers for much longer). They are a
> great way to make readable data structures that have internal structure
> _without_ having to have that structure show up unnecessarily in usage.

Actually, I believe they are an extension, which GCC honors.  Unnamed
structures in standard C99 are actually declaring an unnamed type, not
an unnamed member.  Try it:

     struct {
       int a;
       union {
         int b;
         float c;
       };
       int d;
     } foo;

int bar()
{
  return foo.a + foo.d + foo.b;
}


With -std=c99, the reference to foo.b is an error; with -std=gnu99 or
-std=gnu89, it is accepted.


I don't know why they were getting rejected for Paul, though.  Did you
have GNU set to -ansi mode?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

  parent reply	other threads:[~2003-06-07 16:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-05 21:34 [CHECKER][PATCH] awe_wave.c user pointer dereference Hollis Blanchard
2003-06-05 22:07 ` Linus Torvalds
2003-06-06 16:46   ` __user annotations Hollis Blanchard
2003-06-06 17:28     ` Linus Torvalds
2003-06-07  0:32       ` Paul Mackerras
2003-06-07  0:42         ` Sam Ravnborg
2003-06-07  0:52           ` Paul Mackerras
2003-06-07  0:43         ` Linus Torvalds
2003-06-07  1:06           ` Arnaldo Carvalho de Melo
2003-06-07  1:09             ` Paul Mackerras
2003-06-07 16:49           ` Daniel Jacobowitz [this message]
2003-06-08  2:17             ` Paul Mackerras
2003-06-07 12:32       ` Ingo Oeser
2003-06-07 16:25         ` Linus Torvalds
2003-06-07 16:43           ` Sam Ravnborg
2003-06-07 16:48             ` Sam Ravnborg

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=20030607164936.GA18862@nevyn.them.org \
    --to=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@transmeta.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

all inboxes | Powered by JetHome®