From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Christopher Li <sparse@chrisli.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-sparse@vger.kernel.org
Subject: Re: Bogus sparse warning?
Date: Tue, 13 Feb 2007 09:39:43 +0000 [thread overview]
Message-ID: <427C14A0-ED1F-4A13-B5BD-106E491A23F1@cam.ac.uk> (raw)
In-Reply-To: <20070213014657.GA2922@chrisli.org>
Hi,
On 13 Feb 2007, at 01:46, Christopher Li wrote:
> I see. In evaluate_call().
> evaluate_arguments() is called before target function arguments
> are converted into pointers.
>
> Can you please try this patch instead?
This one works! (-:
I put it in and now it does not matter whether the linux/fs.h
get_bloc_t typedef has the "*" or not, both times it does not give a
warning at all:
CHECK fs/ntfs/file.c
CC [M] fs/ntfs/file.o
Best regards,
Anton
>
> Chris
>
> Index: sparse/symbol.h
> ===================================================================
> --- sparse.orig/symbol.h 2007-02-12 18:10:01.000000000 -0800
> +++ sparse/symbol.h 2007-02-12 18:10:06.000000000 -0800
> @@ -191,6 +191,7 @@ struct symbol {
> #define MOD_SIZE (MOD_CHAR | MOD_SHORT | MOD_LONG | MOD_LONGLONG)
> #define MOD_IGNORE (MOD_TOPLEVEL | MOD_STORAGE | MOD_ADDRESSABLE | \
> MOD_ASSIGNED | MOD_USERTYPE | MOD_FORCE | MOD_ACCESSED |
> MOD_EXPLICITLY_SIGNED)
> +#define MOD_PTRINHERIT (MOD_VOLATILE | MOD_CONST | MOD_NODEREF |
> MOD_STORAGE)
>
>
> /* Current parsing/evaluation function */
> Index: sparse/evaluate.c
> ===================================================================
> --- sparse.orig/evaluate.c 2007-02-12 18:10:01.000000000 -0800
> +++ sparse/evaluate.c 2007-02-12 18:10:48.000000000 -0800
> @@ -1282,11 +1282,11 @@ static void examine_fn_arguments(struct
> else
> ptr->ctype.base_type = arg;
> ptr->ctype.as |= s->ctype.as;
> - ptr->ctype.modifiers |= s->ctype.modifiers;
> + ptr->ctype.modifiers |= s->ctype.modifiers & MOD_PTRINHERIT;
>
> s->ctype.base_type = ptr;
> s->ctype.as = 0;
> - s->ctype.modifiers = 0;
> + s->ctype.modifiers &= ~MOD_PTRINHERIT;
> s->bit_size = 0;
> s->examined = 0;
> examine_symbol_type(s);
> @@ -1313,8 +1313,6 @@ static struct symbol *convert_to_as_mod(
> return sym;
> }
>
> -#define MOD_PTRINHERIT (MOD_VOLATILE | MOD_CONST | MOD_NODEREF |
> MOD_STORAGE)
> -
> static struct symbol *create_pointer(struct expression *expr,
> struct symbol *sym, int degenerate)
> {
> struct symbol *node = alloc_symbol(expr->pos, SYM_NODE);
> @@ -2309,7 +2307,6 @@ static int evaluate_symbol_call(struct e
> int ret;
> struct symbol *curr = current_fn;
> current_fn = ctype->ctype.base_type;
> - examine_fn_arguments(current_fn);
>
> ret = inline_function(expr, ctype);
>
> @@ -2336,6 +2333,7 @@ static struct symbol *evaluate_call(stru
> if (ctype->type == SYM_PTR || ctype->type == SYM_ARRAY)
> ctype = get_base_type(ctype);
>
> + examine_fn_arguments(ctype);
> if (sym->type == SYM_NODE && fn->type == EXPR_PREOP &&
> sym->op && sym->op->args) {
> if (!sym->op->args(expr))
>
>
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/
next prev parent reply other threads:[~2007-02-13 9:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-12 10:05 Bogus sparse warning? Anton Altaparmakov
2007-02-12 18:28 ` Linus Torvalds
2007-02-12 19:14 ` Christopher Li
2007-02-12 19:53 ` Linus Torvalds
2007-02-13 8:30 ` Josh Triplett
2007-02-13 0:15 ` Anton Altaparmakov
2007-02-13 1:46 ` Christopher Li
2007-02-13 8:22 ` Josh Triplett
[not found] ` <20070213190400.GA9989@chrisli.org>
2007-02-13 23:01 ` Josh Triplett
2007-02-13 9:39 ` Anton Altaparmakov [this message]
2007-02-13 0:25 ` Anton Altaparmakov
2007-02-13 0:42 ` Linus Torvalds
2007-02-13 9:53 ` Anton Altaparmakov
2007-02-13 16:10 ` Linus Torvalds
2007-02-13 21:23 ` Anton Altaparmakov
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=427C14A0-ED1F-4A13-B5BD-106E491A23F1@cam.ac.uk \
--to=aia21@cam.ac.uk \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.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.