On Thu, Jan 22, 2015 at 10:20:44AM +0000, David Binderman wrote:
> I used the static analyser cppcheck to find these two bugs, but
> you might be able to find similar problems by using gcc compiler
> flag -Wlogical-op.
I turned it on, but GCC 4.7.2 doesn't find anything for me.
It complains about:
if (x != 1 || x != 2)
but it doesn't complain about:
if (x == 0 || x != 1 || x != 2)
Smatch is similar to GCC in this regard...
regards,
dan carpenter
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel