From: Chris Forbes <chrisf@ijw.co.nz>
To: linux-sparse@vger.kernel.org
Subject: [RFC PATCH 0/2] check for identical exprs on LHS and RHS of '&&'
Date: Wed, 10 Aug 2011 21:07:13 +1200 [thread overview]
Message-ID: <1312967235-23817-1-git-send-email-chrisf@ijw.co.nz> (raw)
Hi, I've started working on a new check for sparse to pick up a common
error -- identical expressions appearing on both sides of some binary
operators.
This initially supports '&&', and incompletely -- but the plan is to
check instances of '!=', '==' and '||' the same way.
The check relies on recursively walking the ->left and ->right expressions,
looking for differences. The implementation is a little verbose, but can
be shared between all the operators.
What I'd like to know is:
* Do people consider this a worthwhile check to make?
* Am I "doing it right" with the expression walking?
* Are there other cases which people would be interested in?
Cheers
-- Chris
next reply other threads:[~2011-08-10 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 9:07 Chris Forbes [this message]
2011-08-10 9:07 ` [PATCH 1/2] add test case for identical exprs on LHS and RHS of '&&' operator Chris Forbes
2011-08-10 9:07 ` [PATCH 2/2] initial work on check for identical exprs on both sides of '&&'; needs more Chris Forbes
2011-08-10 17:44 ` [RFC PATCH 0/2] check for identical exprs on LHS and RHS of '&&' Josh Triplett
2011-08-10 17:46 ` Al Viro
2011-08-12 19:34 ` Dan Carpenter
2011-08-12 19:16 ` Christopher Li
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=1312967235-23817-1-git-send-email-chrisf@ijw.co.nz \
--to=chrisf@ijw.co.nz \
--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).