From: Joe Perches <joe@perches.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ben Pfaff <blp@nicira.com>,
Christopher Li <sparse@chrisli.org>
Cc: Josh Triplett <josh@joshtriplett.org>,
linux-sparse@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] sparse: Allow override of sizeof(bool) warning
Date: Wed, 26 Feb 2014 19:38:46 -0800 [thread overview]
Message-ID: <1393472326.24588.82.camel@joe-AO722> (raw)
In-Reply-To: <530EB103.5070406@zytor.com>
(adding Ben Pfaff and Christopher Li)
On Wed, 2014-02-26 at 19:29 -0800, H. Peter Anvin wrote:
> On 02/26/2014 06:58 PM, Josh Triplett wrote:
> > On Wed, Feb 26, 2014 at 06:53:14PM -0800, Joe Perches wrote:
> >> Allow an override to emit or not the sizeof(bool) warning
> >> Add a description to the manpage.
> >>
> >> Signed-off-by: Joe Perches <joe@perches.com>
> >
> > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> >
>
> I have to admit that this particular warning is a bit odd to me. I'm
> wondering what kind of bugs it was intended to catch.
>
> In particular, things that incorrectly assumes the size of bool to be
> anything in particular would seem unlikely to actually use sizeof().
Dunno, the commit log for the commit that added it doesn't quite
match the code and is seemingly unaware that the c99 spec doesn't
specify sizeof(bool).
Ben Pfaff <blp@nicira.com>
Date: Wed May 4 16:39:54 2011 -0700
evaluate: Allow sizeof(_Bool) to succeed.
Without this commit, sizeof(_Bool) provokes an error with "cannot size
expression" because _Bool is a 1-bit type and thus not a multiple of a full
byte in size. But sizeof(_Bool) is valid C that should evaluate to 1, so
this commit fixes the problem and adds a regression test.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
next prev parent reply other threads:[~2014-02-27 3:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <530E6F76.1070605@zytor.com>
[not found] ` <1393462087.24588.50.camel@joe-AO722>
[not found] ` <530E8C2E.7080307@zytor.com>
2014-02-27 2:03 ` [PATCH] sparse: Allow override of sizeof(bool) warning Joe Perches
2014-02-27 2:28 ` Josh Triplett
2014-02-27 2:53 ` [PATCH V2] " Joe Perches
2014-02-27 2:58 ` Josh Triplett
2014-02-27 3:19 ` [PATCH V3] " Joe Perches
2014-02-27 3:29 ` [PATCH V2] " H. Peter Anvin
2014-02-27 3:38 ` Joe Perches [this message]
2014-02-27 3:42 ` H. Peter Anvin
2014-02-27 8:25 ` Borislav Petkov
2014-02-27 15:10 ` H. Peter Anvin
2014-02-27 15:24 ` Theodore Ts'o
2014-02-27 15:48 ` H. Peter Anvin
2014-02-27 16:01 ` Borislav Petkov
2014-02-27 16:10 ` Dan Carpenter
2014-02-27 16:52 ` H. Peter Anvin
2014-02-27 17:06 ` James Hogan
2014-02-27 4:00 ` Ben Pfaff
2014-02-27 4:19 ` H. Peter Anvin
2014-02-27 4:26 ` Ben Pfaff
2014-02-27 4:32 ` H. Peter Anvin
2014-02-27 20:22 ` Christopher Li
2014-02-27 20:26 ` H. Peter Anvin
2014-02-27 20:39 ` Joe Perches
2014-02-27 20:55 ` Christopher Li
2014-02-27 21:49 ` Joe Perches
2014-02-27 20:44 ` Christopher Li
2014-02-27 21:00 ` Joe Perches
2014-02-27 21:03 ` Christopher Li
2014-02-27 21:41 ` 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=1393472326.24588.82.camel@joe-AO722 \
--to=joe@perches.com \
--cc=blp@nicira.com \
--cc=hpa@zytor.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--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).