Re: Sparse RFC

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

 



Hi Darren,


Derek M Jones wrote:
> 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.
You have to consider ## and #, too.  E.g. look at
include/linux/stringify.h, or SOCKCALL_WRAP in include/linux/net.h

BTW, SOCKCALL_WRAP is funny anyhow, because the last two arguments are
supposed to be function arguments (resp. their type list).

Best regards
Uwe


-- 
Uwe Kleine-König

http://www.google.com/search?q=5%2B7
-
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