Daniel Marjamäki
Daniel Marjamäki
the PR description says that you want to detect: ``` if(f2(0), 0) //actually mean f2(0, 0) ``` well yes that looks like a possible bug. there seems to be misplaced...
I also want to point out that misra has a rule that forbids comma operators. But I still feel sympathy for this checker if we make it more specific and...
> So maybe it is a little difficult to completely decide if the code is intended or not by a static analysis. yeah.. and when you say "a little difficult"...
you don't have to do it in this PR but I think this warning could be more generic and written for other statements also. Example: ``` x = 2 *...
I feel that it would be good to run test-my-pr.py script and investigate if the warnings look correct..
@clock999 thanks! Sometimes old builds mess it up because the script uses different build flags etc.. so if you remove the build folder and all old *.o files etc you...
> HI Danmar, yes, CheckCondition::alwaysTrueFalse does not handle the comma expression. With below code, no message is reported for known condition value. ok thanks for your investigation.. Let's just leave...
I suggest that no warning is written here: ``` void foo(int x, int y=0) ; void bar() { if (foo(1,2),1) {} } ```
I have executed test-my-pr.py I got some warnings in Poppler project for such code: ``` if (obj = parser->getObj(true), !obj.isInt()) { ``` However this looks intentional as the getObj declaration...
I would not be against some exception for `a=f(), some expression using a`. But I don't have a strong opinion you can decide about that.