From: Josh Triplett <josht@linux.vnet.ibm.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Josh Triplett <josh@freedesktop.org>,
linux-sparse@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] bloody mess with __attribute__() syntax
Date: Thu, 05 Jul 2007 14:09:16 -0700 [thread overview]
Message-ID: <1183669756.2604.117.camel@josh-work.beaverton.ibm.com> (raw)
In-Reply-To: <20070705200839.GR21478@ftp.linux.org.uk>
On Thu, 2007-07-05 at 21:08 +0100, Al Viro wrote:
> On Thu, Jul 05, 2007 at 12:35:53PM -0700, Josh Triplett wrote:
> > OK, that seems inconsistent with what you said before. You said that
> > T __attribute__((foo)) *v;
>
> ... in gcc.
>
> > gives you a foo-pointer-to-T. So shouldn't
> > int __attribute__((noderef)) *v;
> > give you a noderef-pointer-to-int?
>
> ... if we followed gcc rules.
Ah, OK.
> > However, noderef seems like a property of a pointer, hence why I
> > proposed the example I did. A warning should occur when you do
> > *(<noderef T *>v) to get a T, not when you do *(<* noderef T>v) to get a
> > noderef T.
>
> Nope. __noderef is a property of object being pointed to. Again,
> consider &p->x. It should not be int *. And it should not be
> an error. We want it to be int __noderef *.
>
> Semantics of noderef is simple: you should not access or modify the value
> of noderef object. That's all. int __noderef * is an absolutely normal
> pointer to such object. Think of __noderef as of a stronger variant of const.
OK. It hadn't occurred to me that "noderef int x" could have any useful
meaning on its own, but you've given a clear explanation of why it does,
which makes it meaningful to apply noderef to the pointer target rather
than the pointer. Thanks.
- Josh Triplett
next prev parent reply other threads:[~2007-07-05 21:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-05 9:35 [RFC] bloody mess with __attribute__() syntax Al Viro
2007-07-05 12:03 ` Arnd Bergmann
[not found] ` <OFC2AA6078.1DF7BE7E-ON4225730F.0044BE34-4225730F.0046B6F1@de.ibm.com>
2007-07-05 16:27 ` Al Viro
2007-07-13 9:04 ` Al Viro
2007-07-05 15:36 ` Josh Triplett
2007-07-05 16:43 ` Al Viro
2007-07-05 18:50 ` Josh Triplett
2007-07-05 19:13 ` Al Viro
2007-07-05 19:35 ` Josh Triplett
2007-07-05 20:08 ` Al Viro
2007-07-05 20:56 ` Linus Torvalds
2007-07-06 3:26 ` Al Viro
2007-07-05 21:09 ` Josh Triplett [this message]
2007-07-06 7:48 ` Al Viro
2007-07-06 8:33 ` Josh Triplett
2007-07-06 15:52 ` Al Viro
2007-07-06 19:29 ` Josh Triplett
2007-07-07 2:11 ` Al Viro
2007-07-07 2:28 ` Josh Triplett
2007-07-08 21:50 ` Al Viro
2007-07-07 2:30 ` Al Viro
2007-07-07 2:55 ` Josh Triplett
2007-07-08 21:52 ` Al Viro
2007-07-05 16:41 ` Linus Torvalds
2007-07-05 16:53 ` Al Viro
2007-07-05 17:02 ` Chris Lattner
2007-07-05 17:09 ` Al Viro
2007-07-05 17:26 ` Linus Torvalds
2007-07-05 18:07 ` Al Viro
2007-07-05 18:56 ` Linus Torvalds
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=1183669756.2604.117.camel@josh-work.beaverton.ibm.com \
--to=josht@linux.vnet.ibm.com \
--cc=josh@freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ftp.linux.org.uk \
/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 NNTP newsgroup(s).