Messages in this thread | | | From | Roland Dreier <> | Subject | Re: [announce] smatch 1.54 | Date | Wed, 02 Jun 2010 12:20:46 -0700 |
| |
Hi Dan,
I'm trying out smatch on some kernel code now. Neat stuff, but I'm seeing some puzzling false positives relating to signedness. Basically, if I have code like:
__be16 foo; __u16 bar;
foo = cpu_to_be16(128); bar = cpu_to_be16(128);
then the first line warns about 32768 not fitting into foo, but while the second line doesn't warn, even though __be16 is just a __bitwise__ __u16. I don't understand the sparse / smatch internals so I'm not sure why applying __bitwise__ apparently kills the unsigned modifier. Maybe it's an easy fix for you? Otherwise I'll poke at it a little later.
Thanks, Roland -- Roland Dreier <rolandd@cisco.com> || For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/index.html
| |