All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>, linux-sparse@vger.kernel.org
Subject: Re: Casting away noderef and address spaces?
Date: Mon, 22 Dec 2008 21:39:54 +0000	[thread overview]
Message-ID: <20081222213953.GN28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <70318cbf0812221323s53119420qcdb2ee0542185667@mail.gmail.com>

On Mon, Dec 22, 2008 at 01:23:47PM -0800, Christopher Li wrote:
> On Mon, Dec 22, 2008 at 12:57 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > The right solution is
> >        (*(typeof(v) __attribute__((address_space(0), force)) *)(&v))
> >
> > Cast there will take a pointer to type of V and force-cast it to pointer to
> > unqualified type of V.  *(cast)&v will do the obvious thing.  Will trim
> > both the AS and noderef.
> 
> Thanks, that is much better. However sparse don't know how to handle it yet.
> 
> /tmp/typeof.c:11:64: warning: incorrect type in assignment (invalid types)
> /tmp/typeof.c:11:64:    expected unknown type 11 <noident>
> /tmp/typeof.c:11:64:    got int
> 
> classify_type does not know how to handle SYM_TYPEOF yet.
> Let me see if I can make it to work.

Works here (built from 8f208e215a531d2b32aec0428fd5eaa24ae3100b)...

But yes, SYM_TYPEOF is a brittle mess, so whether that works or not
is, er, version-dependent ;-/

I really ought to resurrect lazy-type-expressions branch...

  reply	other threads:[~2008-12-22 21:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  5:36 Casting away noderef and address spaces? Rusty Russell
2008-12-22 20:06 ` Christopher Li
2008-12-22 20:57   ` Al Viro
2008-12-22 21:23     ` Christopher Li
2008-12-22 21:39       ` Al Viro [this message]
2008-12-22 22:33         ` Christopher Li
2008-12-22 22:42           ` Harvey Harrison
2008-12-22 22:57           ` Sam Ravnborg
2008-12-22 23:53             ` Alexey Zaytsev
2008-12-22 23:55               ` Johannes Berg
2008-12-23  0:20                 ` Alexey Zaytsev
2008-12-23  0:35                   ` Johannes Berg
2008-12-23  0:37                   ` Johannes Berg
2008-12-23  1:25                     ` Christopher Li
2008-12-23  9:59                       ` Johannes Berg
2008-12-24  8:34                         ` Christopher Li
2008-12-23  2:14     ` Rusty Russell
2008-12-23  3:02       ` Christopher Li

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=20081222213953.GN28946@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-sparse@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sparse@chrisli.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.