Mkay...
I tried.
> @r@
> {int8_t,int16_t,int32_t,int64_t,
> uint8_t,uint16_t,uint32_t,uint64_t} x;
> type T;
> T y;
> expression list[n] es;
> constant char[] c;
> identifier f;
> position p;
> @@
>
> f(...,c@p,es,x@y,...)
>
> @script:python s@
> T << r.T; // the type of the argument of interest
> c << r.c; // the format string
> n << r.n; // the offset of the argument of interest, counted from 0
> c2;
> @@
fails with:
> ~/projects/FPGA/src/fpgatools/libs$ spatch --sp-file ../pri.sp ./*.c
> init_defs_builtins: /usr/lib/coccinelle/standard.h
> 5 11
> Fatal error: exception Failure("meta: parse error: \n = File \"../pri.sp\",
> line 2, column 1, charpos = 5\n around = 'int8_t', whole content =
> {int8_t,int16_t,int32_t,int64_t,\n")
looking at the main_grammar.pdf reveals that the typedefs are resolved....
Is there a way to match the original typename?
If someone actually wrote long int, the lX is perfectly fine.
if it's one of the stdints it'll change on different subarchs, so it needs the
PRI*.
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci