From: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
To: Darren Jenkins <darrenrjenkins@gmail.com>
Cc: Derek M Jones <derek@knosof.co.uk>,
Sparse mailing list <linux-sparse@vger.kernel.org>
Subject: Re: Sparse RFC
Date: Tue, 27 Mar 2007 14:04:45 +0200 [thread overview]
Message-ID: <20070327120445.GD12178@informatik.uni-freiburg.de> (raw)
In-Reply-To: <4607F19B.6080303@knosof.co.uk>
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
prev parent reply other threads:[~2007-03-27 12:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-26 13:29 Sparse RFC Darren Jenkins\
2007-03-26 16:15 ` Derek M Jones
2007-03-26 21:21 ` Linus Torvalds
2007-03-27 3:07 ` Darren Jenkins
2007-03-27 12:04 ` Uwe Kleine-König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070327120445.GD12178@informatik.uni-freiburg.de \
--to=ukleinek@informatik.uni-freiburg.de \
--cc=darrenrjenkins@gmail.com \
--cc=derek@knosof.co.uk \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).