Skip to contentSkip to conversation

Coccinelle is confuse by extern __printf macro (ie attribute)

Cocci Jerome Glisse 2 participants 3 messages Feb 28, 2019 – Mar 8, 2019

lore
Share & tools
lore
#0 lore raw

Coccinelle get confuse with kernel extern __printf macro for instance:

test.c:
extern __printf(3, 4)
int foo(int, int, char *, ...);
void toto(int, long);

test.sp:
@@
@@
void toto(int,
+void *,
long);

The semantic patch will not work. But if extern is remove or if __printf macro is remove then it works. Also having extern and __printf on different line make it works.

Cheers,
Jérôme
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#1 lore raw
Quoted 14 lines · Jerome Glisse

Coccinelle get confuse with kernel extern __printf macro for instance:

test.c:
extern __printf(3, 4)
int foo(int, int, char *, ...);
void toto(int, long);

test.sp:
@@
@@
void toto(int,
+void *,
long);

Quoted 3 lines

The semantic patch will not work. But if extern is remove or if __printf macro is remove then it works. Also having extern and __printf on different line make it works.

Maybe adding

#define __printf(a,b)

to standard.h will help?

julia

Quoted 8 lines

Cheers,
Jérôme
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

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

#2 lore raw
Quoted 22 lines · Julia Lawall
Quoted 14 lines · Jerome Glisse

Coccinelle get confuse with kernel extern __printf macro for instance:

test.c:
extern __printf(3, 4)
int foo(int, int, char *, ...);
void toto(int, long);

test.sp:
@@
@@
void toto(int,
+void *,
long);

Quoted 3 lines

The semantic patch will not work. But if extern is remove or if __printf macro is remove then it works. Also having extern and __printf on different line make it works.

Quoted 6 lines

Maybe adding

#define __printf(a,b)

to standard.h will help?

Sorry to get back so late, yes adding #define __printf(a,b) to standard.h solve the issue. Thank you for the pointer.

Cheers,
Jérôme
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci