cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] macro parameters and expressions?
@ 2019-10-11  7:42 Jürgen Groß
  2019-10-11 20:00 ` Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 33+ messages in thread
From: Jürgen Groß @ 2019-10-11  7:42 UTC (permalink / raw)
  To: cocci

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?


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

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2019-10-17  9:34 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11  7:42 [Cocci] macro parameters and expressions? Jürgen Groß
2019-10-11 20:00 ` Julia Lawall
2019-10-13 13:37   ` Markus Elfring
     [not found]     ` <alpine.DEB.2.21.1910131806400.2565@hadrien>
2019-10-13 16:33       ` [Cocci] Adjusting macros with SmPL? Markus Elfring
2019-10-13 16:37         ` Julia Lawall
2019-10-13 16:50           ` Markus Elfring
2019-10-14  9:08           ` Markus Elfring
2019-10-14 10:24             ` Julia Lawall
2019-10-14 11:00               ` Markus Elfring
2019-10-15  8:20               ` Markus Elfring
2019-10-16 14:16               ` [Cocci] Adjustments with SmPL after macros? Markus Elfring
2019-10-16 15:23                 ` Julia Lawall
2019-10-16 16:48                   ` Markus Elfring
     [not found]                     ` <alpine.DEB.2.21.1910161850250.3539@hadrien>
2019-10-16 16:55                       ` Markus Elfring
2019-10-17  9:33                   ` Markus Elfring
     [not found]   ` <fb924870-4bc2-1ca0-4fa4-0ddbf7ebb9d2@suse.com>
2019-10-14 11:14     ` [Cocci] macro parameters and expressions? Julia Lawall
2019-10-14 11:50       ` Markus Elfring
2019-10-14 13:33       ` Jürgen Groß
2019-10-14 14:03         ` Julia Lawall
2019-10-13 13:28 ` Markus Elfring
2019-10-13 13:36   ` Julia Lawall
2019-10-13 14:22     ` [Cocci] Checking the influence of “virtual” SmPL variables Markus Elfring
2019-10-13 16:09       ` Julia Lawall
2019-10-13 16:39         ` Markus Elfring
2019-10-14 15:33 ` [Cocci] macro parameters and expressions? Markus Elfring
     [not found]   ` <alpine.DEB.2.21.1910141740580.2330@hadrien>
2019-10-14 16:05     ` Markus Elfring
2019-10-15  6:44     ` Markus Elfring
2019-10-15  6:54       ` Markus Elfring
2019-10-15  7:40       ` Markus Elfring
2019-10-15  8:05       ` Julia Lawall
2019-10-15  8:34         ` Markus Elfring
2019-10-15  9:07         ` Markus Elfring
2019-10-15  9:28           ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).