On Mon, 14 Oct 2019, Markus Elfring wrote:

> > Changes within #define code should be supported if Coccinelle is able
> > to parse the code independently of its usage context.
>
> I suggest to take a closer look at the current software situation.
>
> @replacement@
> expression x;
> identifier macro;
> @@
>  #define macro(name)
> -snprintf
> +spgprintf_d
>  (...,
> -PAGE_SIZE, "%d\n",
>  (x)->name)
>
>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci 
> use_spgprintf2.cocci
> …
> minus: parse error:
>   File "use_spgprintf2.cocci", line 11, column 0, charpos = 132
>   around = '',
>   whole content =
>
>
> Can such an error message be explained better?
>
>
> I imagine that context-dependent data processing will be needed here
> to distinguish if preprocessor code should be adjusted (or not).
> How much will this technical aspect matter?

Macros are supposed to be written on one line.

Anyway, to my understanding the goal was not to modify the #define part,
but rather only the code part.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to