Re: sparse: ioctl defines and "error: bad integer constant expression"

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

 



On Mon, Mar 31, 2014 at 1:06 AM, Hans Verkuil <hverkuil@xxxxxxxxx> wrote:
>
> Running sparse over this gives:
>
> error: bad integer constant expression

So technically sparse is correct in this case. The kernel ends up
doing some questionable things that gcc allows. The index in an
assignment initializer is supposed to be a true constant expression,
not "constant expression after simplification and optimization".

So sparse warns about us playing games that just happen to work with
gcc. I'm not sure we should fix sparse for this case.

I'll think about it, but not right now (I did the previous one because
it was trivial, but now I'm in merge window mode, so I'd better go
back and look at kernel pull requests)

Chris, can you please add this to the test cases since Hans did the
work to create a nice small test-case?

            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