On Fri, 15 Jun 2012, SF Markus Elfring wrote:

> > > Hi guys, I wanna covert linux's printk:
> > >     printk(KERN_DEBUG "MAC address is multicast\n");
> > > to freebsd's print:
> > >     printf("MAC address is multicast\n");
>
> Would an approach like the following work with the semantic patch language?
>
> @@
> declarer name xyz =~ "KERN_DEBUG";
> @@
> -printk(xyz "my message\n");
> +printf("%s", "my message\n");

It does not work.  The SMPL language does not accept X "Y" as a string.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to