* generic bool and sparse errors?
@ 2007-06-06 18:29 Kok, Auke
2007-06-06 19:00 ` Jeff Garzik
2007-06-06 19:19 ` Richard Knutsson
0 siblings, 2 replies; 5+ messages in thread
From: Kok, Auke @ 2007-06-06 18:29 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Al Viro, Linus Torvalds, Josh Triplett
I'm experimenting with using the generic bool type and using sparse I get tons
of these messages:
warning: incorrect type in argument 4 (different signedness)
expected bool [unsigned] [usertype] *[unsigned] success
got bool *<noident>
I'm not really worried about this, I assume that sparse hasn't caught up with
what bool really means, but perhaps this can be looked into by someone who knows
sparse well. The warnings don't really add up and with more people switching to
use the generic bool this may beceome unwanted.
alternatively we might need to reconsider the `typedef _Bool bool;` declaration
and force it to be unsigned. I'm not sure what to think of that.
Cheers,
Auke
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: generic bool and sparse errors?
2007-06-06 18:29 generic bool and sparse errors? Kok, Auke
@ 2007-06-06 19:00 ` Jeff Garzik
2007-06-06 19:19 ` Richard Knutsson
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2007-06-06 19:00 UTC (permalink / raw)
To: Kok, Auke
Cc: Linux Kernel Mailing List, Al Viro, Linus Torvalds, Josh Triplett
On Wed, Jun 06, 2007 at 11:29:30AM -0700, Kok, Auke wrote:
> alternatively we might need to reconsider the `typedef _Bool bool;`
> declaration and force it to be unsigned. I'm not sure what to think of that.
That's the C99 standard declaration IIRC. Probably just need to __force
it to something for sparse, deep in the bowels of kernel headers...
Jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: generic bool and sparse errors?
2007-06-06 18:29 generic bool and sparse errors? Kok, Auke
2007-06-06 19:00 ` Jeff Garzik
@ 2007-06-06 19:19 ` Richard Knutsson
2007-06-06 20:17 ` Kok, Auke
1 sibling, 1 reply; 5+ messages in thread
From: Richard Knutsson @ 2007-06-06 19:19 UTC (permalink / raw)
To: Kok, Auke
Cc: Linux Kernel Mailing List, Al Viro, Linus Torvalds, Josh Triplett
Kok, Auke wrote:
>
> I'm experimenting with using the generic bool type and using sparse I
> get tons of these messages:
>
> warning: incorrect type in argument 4 (different signedness)
> expected bool [unsigned] [usertype] *[unsigned] success
> got bool *<noident>
>
> I'm not really worried about this, I assume that sparse hasn't caught
> up with what bool really means, but perhaps this can be looked into by
> someone who knows sparse well. The warnings don't really add up and
> with more people switching to use the generic bool this may beceome
> unwanted.
Actually, I am "assigned" to that. :)
Just out of curiousity, where do you see those messages? In the log for
allyesconfig on i386 I only found ntfs/super.c with similar output.
>
> alternatively we might need to reconsider the `typedef _Bool bool;`
> declaration and force it to be unsigned. I'm not sure what to think of
> that.
I do not see how that would make any sense.
Richard Knutsson
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: generic bool and sparse errors?
2007-06-06 19:19 ` Richard Knutsson
@ 2007-06-06 20:17 ` Kok, Auke
2007-06-06 20:24 ` Al Viro
0 siblings, 1 reply; 5+ messages in thread
From: Kok, Auke @ 2007-06-06 20:17 UTC (permalink / raw)
To: Richard Knutsson
Cc: Linux Kernel Mailing List, Al Viro, Linus Torvalds, Josh Triplett
Richard Knutsson wrote:
> Kok, Auke wrote:
>> I'm experimenting with using the generic bool type and using sparse I
>> get tons of these messages:
>>
>> warning: incorrect type in argument 4 (different signedness)
>> expected bool [unsigned] [usertype] *[unsigned] success
>> got bool *<noident>
>>
>> I'm not really worried about this, I assume that sparse hasn't caught
>> up with what bool really means, but perhaps this can be looked into by
>> someone who knows sparse well. The warnings don't really add up and
>> with more people switching to use the generic bool this may beceome
>> unwanted.
>
> Actually, I am "assigned" to that. :)
ah cool
> Just out of curiousity, where do you see those messages? In the log for
> allyesconfig on i386 I only found ntfs/super.c with similar output.
I was poking around replacing the boolean_t typedef in e1000, so it's nothing
upstream. Just run `sed -i s/boolean_t/bool/g` on all the files in
drivers/net/e1000 to see :)
the version of sparse is that in fc6, so that may be out-of-date (?).
>> alternatively we might need to reconsider the `typedef _Bool bool;`
>> declaration and force it to be unsigned. I'm not sure what to think of
>> that.
> I do not see how that would make any sense.
well the sparse warning is about signedness. Either sparse needs to "know" that
bool is unsigned, or the kernel headers need to somehow make bool unsigned...
the latter choice would come down to just that, but it doesn't look like a good
idea to me either somehow.
Auke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: generic bool and sparse errors?
2007-06-06 20:17 ` Kok, Auke
@ 2007-06-06 20:24 ` Al Viro
0 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2007-06-06 20:24 UTC (permalink / raw)
To: Kok, Auke
Cc: Richard Knutsson, Linux Kernel Mailing List, Linus Torvalds,
Josh Triplett
On Wed, Jun 06, 2007 at 01:17:44PM -0700, Kok, Auke wrote:
> well the sparse warning is about signedness. Either sparse needs to "know"
> that bool is unsigned, or the kernel headers need to somehow make bool
> unsigned... the latter choice would come down to just that, but it doesn't
> look like a good idea to me either somehow.
sparse treats _Bool as 1-bit integer type. It's considerably more
complicated beast; for one thing (_Bool)2 is 1, not 0. For another,
several places make unpleasant assumptions that size in bits is a
multiple of bits_in_char. Which would be fine, but sparse has it
set to 1 for _Bool. With obvious results...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-06-06 20:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 18:29 generic bool and sparse errors? Kok, Auke
2007-06-06 19:00 ` Jeff Garzik
2007-06-06 19:19 ` Richard Knutsson
2007-06-06 20:17 ` Kok, Auke
2007-06-06 20:24 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox