Skip to contentSkip to conversation

matching "..." va_list args

Cocci Jonathan Klee 2 participants 2 messages Nov 6, 2014

lore
Share & tools
lore
#0 lore raw

Dear all,

Since "..." basically means anything, I was wondering if we can match "..." va_list kind of arguments in a function prototype.
I would like to do something like :

@@
identifier f, a;
type T, A;
@@
-T f(A a, ...);
+T f(A a, ...) { va_list args; va_start(args, a); va_stop(args); }

Regards,
jklee

#1 lore raw

Review

Quoted 12 lines · Jonathan Klee

Dear all,

Since "..." basically means anything, I was wondering if we can match "..." va_list kind of arguments in a function prototype.
I would like to do something like :

@@
identifier f, a;
type T, A;
@@

(quoted diff) +1 -1
-T f(A a, ...);
+T f(A a, ...) { va_list args; va_start(args, a); va_stop(args); }

It is currently not supported, but someone is working on it. I hope that it could be available in a couple of weeks (the person only works on Coccinelle part time).

julia