linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Edward Cree <ecree@solarflare.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: Casting 0 to a __bitwise type
Date: Tue, 14 Feb 2017 23:51:30 +0100	[thread overview]
Message-ID: <20170214225127.gxvtfnbe5dkqp4lq@macbook.local> (raw)
In-Reply-To: <9c361aab-ee4b-8309-ff1a-b0e65bb93c5d@solarflare.com>

On Tue, Feb 14, 2017 at 09:36:40PM +0000, Edward Cree wrote:
> I'm given to understand that bitwise types consider 0 'special', in that
>  sparse will allow, say:
>         typedef __u32 __bitwise __be32;
>         __be32 value = 0;
> However, it appears that if I try to cast a constant 0 to a bitwise type,
>         static inline void ip6_fill_mask(__be32 *mask)
>         {
>                 mask[0] = mask[1] = mask[2] = mask[3] = ~(__be32)0;
>         }
> sparse complains "warning: cast to restricted __be32".

I can't reproduce this with the current head.
Wich version of sparse are you using? Can you retry with sparse's head?


Luc Van Oostenryck

  reply	other threads:[~2017-02-14 22:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 21:36 Casting 0 to a __bitwise type Edward Cree
2017-02-14 22:51 ` Luc Van Oostenryck [this message]
2017-02-17 11:01   ` Edward Cree
2017-02-17 12:37     ` Luc Van Oostenryck
2017-02-17 13:13       ` Edward Cree
2017-02-17 14:16         ` Luc Van Oostenryck
2017-02-17 14:56           ` Edward Cree

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=20170214225127.gxvtfnbe5dkqp4lq@macbook.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=ecree@solarflare.com \
    --cc=linux-sparse@vger.kernel.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).