linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] check for identical exprs on LHS and RHS of '&&'
@ 2011-08-10  9:07 Chris Forbes
  2011-08-10  9:07 ` [PATCH 1/2] add test case for identical exprs on LHS and RHS of '&&' operator Chris Forbes
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Chris Forbes @ 2011-08-10  9:07 UTC (permalink / raw)
  To: linux-sparse

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-12 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-10  9:07 [RFC PATCH 0/2] check for identical exprs on LHS and RHS of '&&' Chris Forbes
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

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).