Hello! Thank you Daniel for extending the IdenticalExprChecker. Imho these checks are very useful.
About such code: if (foo()) { doSomething(); } else if (bar()) { /* no action needed */ } else { /* FIXME: Implement this. */ } You could warn here. However there will some noise. In my opinion it is not very rare to have identical blocks of code in if and else blocks by intention. My feeling is that for instance MISRA enforce some identical blocks because there must always be an empty else if the "else" logic should be to do nothing. Here is one real code example where there are identical blocks by intention. The TODO means that the code could be enhanced but it's fine for now. https://github.com/danmar/cppcheck/blob/6bfd4af5/lib/checkunusedvar.cpp#L528 I have not tried your patch yet though. I have access to some misra compatible code I could test it on. Best regards, Daniel Marjamäki .................................................................................................................. Daniel Marjamäki Senior Engineer Evidente ES East AB Warfvinges väg 34 SE-112 51 Stockholm Sweden Mobile: +46 (0)709 12 42 62 E-mail: Daniel.Marjamaki<mailto:daniel.marjam...@evidente.se>@evidente.se<mailto:daniel.marjam...@evidente.se> www.evidente.se
_______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits