On Fri, 11 Oct 2019, Jürgen Groß wrote:

> Hi,
>
> I have a simple semantic patch:
>
>   virtual patch
>
>   @@
>   expression buf, val;
>   @@
>   - snprintf(buf, PAGE_SIZE, "%d\n", val)
>   + spgprintf_d(buf, val)
>
> This works nearly always as expected, but not in some macros. The cases
> where it is not working are those when "val" is using a parameter of the
> macro, e.g.:
>
>   #define MACRO(name)    snprintf(pg, PAGE_SIZE, %u\n", ptr->name)
>
> Is that on purpose? If yes, how can this be avoided?

I don't think it should be on purpose.  Could you send some C code that
illustrates the problem?

thanks,
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to