Re: [RFC][PATCH] fix casting constant to _Bool

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

 



On Sat, Jun 16, 2012 at 9:59 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> It's pretty rare to see a cast to bool that truncates the value.
> My feeling is that most times they are bugs.  I just saw one of
> these a couple weeks ago:
>
> http://www.spinics.net/lists/linux-iio/msg05573.html
>
> I wish the error message could be fixed so it says 1 instead of 0.

Hmm - I could imagine havinbg a warning, but it shouldn't be about truncation.

Maybe something like "Odd constant _Bool cast (%lld -> 1)"? It will
always result in 1, since the only value that results in 0 is 0 (and
isn't odd).

               Linus
--
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