Re: [PATCH] evaluate: Allow sizeof(_Bool) to succeed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 9, 2011 at 1:02 PM, Ben Pfaff <blp@xxxxxxxxxx> wrote:

> Thank you for applying my patch.  It does work for me, in the sense
> that I get a warning instead of an error now, but I'm not so happy to
> get any diagnostic at all.  Is there some reason why sizeof(_Bool)
> warrants a warning when, say, sizeof(long) does not?  After all, both
> sizes are implementation defined.

Because sizeof(_Bool) is a little bit special compare to sizeof(long).
In the case of long, all sizeof(long) * 8 bits are use in the actual value.
But for the _Bool, only the 1 bit is used in the 8 bits size. In other words,
the _Bool has a special case of the actual bit size is not a multiple of 8.

Sparse has two hats, it is a C compiler front end, and more often it is
used in the Linux kernel source sanitize checking. Depending on the sizeof
_Bool sounds a little bit suspicious in the kernel. I would love to the heard
your actual usage case of the sizeof(_Bool). Why do you care about this
warning?

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux