Re: Sparse RFC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Darren,

I have been playing around with the sparse code, and was thinking of
adding a few of the checks that my company uses from other code
checkers, starting with checking that macro arguments have brackets
around them. (Because this is the test my/other code most often fails)

This is a useful check.  However, you need to make sure that
cases where the presence of () have no impact are not flagged
if the parameter is always used in such contexts.  Otherwise the
noise can be excessive.

2) For the macro argument checking would it be better if I checked for
either a bracket or low precedence operator on both sides of the
argument ? like either a comma or a type of assignment operator? it
would not be a foolproof check then but would seem more sensible to me,
and might be more acceptable to users.

Don't make the assumption that everybody knows the precedence
of binary operators.  An experiment I ran last year with experienced
developers (average over 10 years) threw up some unexpected results.
See: http://www.knosof.co.uk/cbook/accu06a.pdf

--
Derek M. Jones                              tel: +44 (0) 1252 520 667
Knowledge Software Ltd                      mailto:derek@xxxxxxxxxxxx
Applications Standards Conformance Testing    http://www.knosof.co.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux