linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [RFC PATCH] bits_in_bool should be 8
Date: Tue, 15 Nov 2016 08:23:08 +0800	[thread overview]
Message-ID: <CANeU7QkTp9O3d4NP+9oW3CUdBvS6-65kByroYj-HhnPv5aUhBA@mail.gmail.com> (raw)
In-Reply-To: <1479156643-28563-1-git-send-email-jlayton@redhat.com>

On Tue, Nov 15, 2016 at 4:50 AM, Jeff Layton <jlayton@redhat.com> wrote:
> Given that we're working with byte-addressable machines, each type must
> be at least one byte in size or you'd not be able to take a pointer to
> it.
>
> Noticed at random when I ran the sample "compile" program in the
> sparse source tree vs. a test C program that uses bools. It crashes
> without this patch.

Do you have the test program to crash sparse?

Sparse should handle bool size correctly. The bits_in_bool is
a internal thing for sparse. From sizeof(bool) point of view,
sparse should treat sizeof(bool) as 8 bits. But bool has only
one bit usable value.

Chris

  reply	other threads:[~2016-11-15  0:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 20:50 [RFC PATCH] bits_in_bool should be 8 Jeff Layton
2016-11-15  0:23 ` Christopher Li [this message]
2016-11-15  2:27   ` Jeff Layton

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=CANeU7QkTp9O3d4NP+9oW3CUdBvS6-65kByroYj-HhnPv5aUhBA@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=jlayton@redhat.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).