Re: [PATCH] Detect identical conditions in if-else-if statements

2014-03-11 Thread Anton Yartsev
On 11.03.2014 20:58, Jordan Rose wrote: On Mar 6, 2014, at 13:16 , Daniel Fahlgren > wrote: Hi Jordan, Thanks for reviewing this. On Wed, 2014-03-05 at 14:38 -0800, Jordan Rose wrote: I'm sorry, I managed to miss this one. Please feel free to include me in the To

Re: [PATCH] Detect identical conditions in if-else-if statements

2014-03-11 Thread Jordan Rose
On Mar 6, 2014, at 13:16 , Daniel Fahlgren wrote: > Hi Jordan, > > Thanks for reviewing this. > > On Wed, 2014-03-05 at 14:38 -0800, Jordan Rose wrote: >> I'm sorry, I managed to miss this one. Please feel free to include me >> in the To or CC fields when you have analyzer patches. > >> I'm g

Re: [PATCH] Detect identical conditions in if-else-if statements

2014-03-06 Thread Daniel Fahlgren
Hi Jordan, Thanks for reviewing this. On Wed, 2014-03-05 at 14:38 -0800, Jordan Rose wrote: > I'm sorry, I managed to miss this one. Please feel free to include me > in the To or CC fields when you have analyzer patches. > I'm glad to get this check! It definitely seems useful for copy-paste > c

Re: [PATCH] Detect identical conditions in if-else-if statements

2014-03-05 Thread Jordan Rose
I'm sorry, I managed to miss this one. Please feel free to include me in the To or CC fields when you have analyzer patches. I'm glad to get this check! It definitely seems useful for copy-paste checking. Thanks for doing the timing checks in advance. Comments: + if (Stmt1 && Stmt2) { +co

Re: [PATCH] Detect identical conditions in if-else-if statements

2014-03-05 Thread Daniel Fahlgren
Hi, ping, any comments? Best regards, Daniel Fahlgren On Fri, 2014-02-21 at 08:16 +0100, Daniel Fahlgren wrote: > Hi, > > This patch makes the IdenticalExprChecker warn about code like: > > if (i == 1) { > foo1(); > } else if (i == 1) { > foo2(); > } > > The logic is the same as for binar

[PATCH] Detect identical conditions in if-else-if statements

2014-02-20 Thread Daniel Fahlgren
Hi, This patch makes the IdenticalExprChecker warn about code like: if (i == 1) { foo1(); } else if (i == 1) { foo2(); } The logic is the same as for binary operators. We only need to check the current if statement and the following ones. Just as with the binary operator check that will be O