[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    Re: sparse: ioctl defines and "error: bad integer constant expression"
From:       Linus Torvalds <torvalds () linux-foundation ! org>
Date:       2014-03-31 17:22:49
Message-ID: CA+55aFwpoVwyyUrCroFR1NWCGku=ath6Sxb8uertuBC=Pw0pLw () mail ! gmail ! com
[Download RAW message or body]

On Mon, Mar 31, 2014 at 1:06 AM, Hans Verkuil <hverkuil@xs4all.nl> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic