linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Christopher Li <sparse@chrisli.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Re: error, types differ in signedness
Date: Mon, 5 Feb 2007 13:04:45 -0800	[thread overview]
Message-ID: <20070205130445.c60ae516.rdunlap@xenotime.net> (raw)
In-Reply-To: <20070205200617.GA14964@chrisli.org>

On Mon, 5 Feb 2007 12:06:17 -0800 Christopher Li wrote:

> On Mon, Feb 05, 2007 at 10:54:20AM -0800, Randy Dunlap wrote:
> > The skbuff.[hc] difference is in *getfrag vs. getfrag.
> > The mpage.[hc] difference is in  *get_block vs. getblock.
> > 
> > Questions:
> > 1.  Is the warning valid?
> 
> I don't think so.
> 
> > 2.  Isn't the '*' unnecessary?
> 
> It is valid in C without '*'. Sparse already know the function
> is going to degenerated into function pointers. It wrongly inherent
> the signedness. You get a signed pointer.
> 
> Can you please try this patch?

Yes, that fixes the problems that I was seeing.
Thanks!


> Index: sparse/symbol.h
> ===================================================================
> --- sparse.orig/symbol.h	2007-02-04 23:46:07.000000000 -0800
> +++ sparse/symbol.h	2007-02-05 12:18:30.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-04 00:47:46.000000000 -0800
> +++ sparse/evaluate.c	2007-02-05 12:20:08.000000000 -0800
> @@ -1282,7 +1282,7 @@ 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;
> @@ -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);
> -

---
~Randy

  reply	other threads:[~2007-02-05 21:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05 18:54 error, types differ in signedness Randy Dunlap
2007-02-05 20:06 ` [PATCH] " Christopher Li
2007-02-05 21:04   ` Randy Dunlap [this message]
2007-02-05 22:27   ` Pavel Roskin
2007-02-06  0:16     ` Christopher Li
2007-02-06  1:12       ` Pavel Roskin
2007-02-06 18:36         ` 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=20070205130445.c60ae516.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --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).