> Noticed that the nuveau driver uses a fair number of > if (var=val,boolean-condition){} > which while legal C-code just makes it hard to read > - and some seems buggy actually.
Do you find another analysis approach nicer for the semantic patch language than the existing check “ASSIGN_IN_IF” by a known Perl script? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl?id=a3ac7917b73070010c05b4485b8582a6c9cd69b6#n4847 https://systeme.lip6.fr/pipermail/cocci/2018-September/005316.html I suggest to take another look at recurring implementation details also within SmPL scripts. 1. SPDX identifier 2. SmPL dependency specifications 3. Fine-tuning for Python code @bad_if depends on report@ position P; statement S1, S2; expression E1, E2; @@ if@P ((E1), E2) S1 else S2 @script:python depends on report@ p << bad_if.P; @@ coccilib.report.print_report(p[0], "unconditional code hiding in if condition") @fix_bad_if depends on patch@ position P; statement S1, S2; expression E1, E2; @@ +E1; if@P ( - (E1), E2) S1 else S2 Regards, Markus _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci