|
|
|
Re: [PATCH 1/3] evaluate: warn on identical exprs around '&&' | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Sun, Aug 28, 2011 at 10:26:53AM +1200, Chris Forbes wrote: > Adds a warning when identical expressions are found on both sides of the '&&' operator. This is a common error resulting from copy & paste. > > Excludes identical expressions found while preprocessing, so we don't get upset about #if defined(FOO) && defined(BAR), which happens all the time, and is perfectly valid. > > Signed-off-by: Chris Forbes <chrisf@xxxxxxxxx> Very nice patch series! I replied to patch 3 about a bit of patch cleanup, but otherwise this looks fine, and I've wanted to see this check for a while. Would you consider also checking for identical expresions on both sides of an &, |, or ^? The former two seem like likely cases when composing flags, and the latter seems like a likely error as well. Also, how does your patch handle expressions like this: *x++ && *x++ Or this: f() && f() - Josh Triplett -- 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
[Newbies FAQ] [Kernel List] [Site Home] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [Bugtraq] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [DDR & Rambus] [Trinity Fuzzer Tool]