LWN.net Logo

sparse is not to blame

sparse is not to blame

Posted Oct 14, 2005 9:00 UTC (Fri) by viro (subscriber, #7872)
In reply to: sparse is not to blame by proski
Parent article: Introducing gfp_t

__nocast is actually not the best way to do that in sparse (thus
the switch to __bitwise later in the series); it's far too easy
to lose without sparse noticing. E.g. a function with __nocast foo
argument can pass it to function taking foo and nobody will notice;
it warns on implicit conversions, which catches quite a few mismatches,
but not all of them. __bitwise is a type qualifier and it's a lot
stronger. OTOH, it simply had not been there when Linus first added
annotations on (some) allocation functions.

What happens now is (a) switch to typedef (merged); (b) switch to
use of __bitwise in declaration and propagation of gfp_t use to
the rest of places where it's needed (post-2.6.14). Full set of
patches is done, it's just waiting for 2.6.14 to be released.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds