Re: Bogus warning when comparing nocast short variables

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

On Wed, Jul 21, 2010 at 9:51 AM, Pavel Roskin <proski@xxxxxxx> wrote:
> Hello!
> This test file causes a warning:
> typedef short __attribute__((nocast)) u16;
> int main(int argc, char **argv)
> {
>        u16 i = (u16)argc;
>        u16 j = (u16)2;
>        return (i == j);
> }
> $ sparse test1.c
> test1.c:6:17: warning: implicit cast from nocast type
> test1.c:6:22: warning: implicit cast from nocast type

The warning come from the implicit cast in the compare
expression. It try to cast "i" and "j" into "int" type before the

The following patch allow the test-inspect to show the cast

No patch for the fix yet.


Attachment: inspect-cast.patch
Description: Binary data

[Newbies FAQ]     [Kernel List]     [Site Home]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [DDR & Rambus]     [Trinity Fuzzer Tool]

Powered by Linux