Does coccinelle have the notion of signedness?
Julia,
I would like to declare a metatype T, where T is restricted to the set of unsigned types.
(i.e. unsigned long, unsigned int, but not int or long)
cheers,
Mitchell
I would try:
@r@
type T;
identifier i;
@@
T i;
@script:python@
T << r.T;
@@
if "unsigned" not in T:cocci.include_match(False)
@printer@
type r.T;
identifier r.i;
@@
* T i;
Quoted 14 lines · Mitchell Cuddie
Julia,
I would like to declare a metatype T, where T is restricted to the set of unsigned types.
(i.e. unsigned long, unsigned int, but not int or long)
cheers,
Mitchell
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
Signature · 1 line
Peter
Gmail has changed the text format. There is a tab before cocci.include_match(False)
Quoted 39 lines · Peter Senna Tschudin
I would try:
@r@
type T;
identifier i;
@@
T i;@script:python@
T << r.T;
@@
if "unsigned" not in T:cocci.include_match(False)@printer@
type r.T;
identifier r.i;
@@
* T i;Quoted 7 lines · Mitchell Cuddie
Julia,
I would like to declare a metatype T, where T is restricted to the set of unsigned types.
(i.e. unsigned long, unsigned int, but not int or long)
Quoted 7 lines
cheers,
Mitchell
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci--
Peter
Signature · 1 line
Peter
You should be able to do
type T;
unsigned T x;
or perhaps even just
unsigned x;
However, the success of this depends on the software you are working on. Linux code has a huge number of typedefs for various unsigned types.
julia
Quoted 54 lines · Peter Senna Tschudin
Gmail has changed the text format. There is a tab before
cocci.include_match(False)Quoted 39 lines · Peter Senna Tschudin
I would try:
@r@
type T;
identifier i;
@@
T i;@script:python@
T << r.T;
@@
if "unsigned" not in T:cocci.include_match(False)@printer@
type r.T;
identifier r.i;
@@
* T i;Quoted 7 lines · Mitchell Cuddie
Julia,
I would like to declare a metatype T, where T is restricted to the set of unsigned types.
(i.e. unsigned long, unsigned int, but not int or long)
Quoted 7 lines
cheers,
Mitchell
_______________________________________________
Cocci mailing list
Cocci at systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci--
PeterSignature · 5 lines
Peter _______________________________________________ Cocci mailing list Cocci at systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci