linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Fix type_info_expression()
Date: Thu, 5 Feb 2009 19:23:23 +0000	[thread overview]
Message-ID: <20090205192322.GN28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <70318cbf0902051029n11975b41l38f17a635dcf5fbd@mail.gmail.com>

On Thu, Feb 05, 2009 at 10:29:19AM -0800, Christopher Li wrote:

> Setting expr->cast_type = NULL here is not straightly necessary right?
> The expr is EXPR_SIZEOF type, the expr->cast_type is not used in
> evaluation_sizeof. Of course it doesn't hurt, I just want to get a confirm
> that I understand it correct.y.

Take a look at evaluate_type_information().  If ->cast_type is not NULL,
it won't even look at ->cast_expression.  For sizeof (struct foo){0,1} that's
fine (you end with with sizeof(struct foo), essentially), but for
sizeof(struct foo){0,1}.x that'll give you the wrong answer.

IOW, it is necessary.

  reply	other threads:[~2009-02-05 19:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02  7:31 [PATCH] Fix type_info_expression() Al Viro
2009-02-05 18:29 ` Christopher Li
2009-02-05 19:23   ` Al Viro [this message]
2009-02-05 20:21     ` 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=20090205192322.GN28946@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-sparse@vger.kernel.org \
    --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 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).