Checking the display of SmPL isomorphism results (with pointers)
Hello,
I have tried another tiny script variant out for the semantic patch language (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
@display@
expression* x;
statement is, es;
@@
*if (!x)
is
else
es
elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci show_null_pointer_checks.cocci …
if (*!*x *!= *NULL)
…
if (*!*NULL *!= *x)
…
if (*x *!= *NULL *== *NULL)
…
if (*NULL *!= *x *== *NULL)
…
if (*NULL *== *x *!= *NULL)
…
if (*NULL *== *NULL *!= *x)
…
Now I find the shown lines in such a program output questionable. Should these presentations of elements in SmPL disjunctions be shorter?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 31 lines · Markus Elfring
Hello,
I have tried another tiny script variant out for the semantic patch language (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
@display@
expression* x;
statement is, es;
@@
*if (!x)
is
else
eselfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci
show_null_pointer_checks.cocci…
if (*!*x *!= *NULL)
…
if (*!*NULL *!= *x)
…
if (*x *!= *NULL *== *NULL)
…
if (*NULL *!= *x *== *NULL)
…
if (*NULL *== *x *!= *NULL)
…
if (*NULL *== *NULL *!= *x)
…
Quoted 2 lines
Now I find the shown lines in such a program output questionable. Should these presentations of elements in SmPL disjunctions be shorter?
It could probably be improved, but it is difficult to do something perfect. Still, I'm confused about the double comparison to NULL, so I will check on it.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci