cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Coccinelle is confuse by extern __printf macro (ie attribute)
@ 2019-02-28  0:43 Jerome Glisse
  2019-02-28  7:05 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Glisse @ 2019-02-28  0:43 UTC (permalink / raw)
  To: cocci

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
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Coccinelle is confuse by extern __printf macro (ie attribute)
  2019-02-28  0:43 [Cocci] Coccinelle is confuse by extern __printf macro (ie attribute) Jerome Glisse
@ 2019-02-28  7:05 ` Julia Lawall
  2019-03-08 18:15   ` Jerome Glisse
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2019-02-28  7:05 UTC (permalink / raw)
  To: Jerome Glisse; +Cc: cocci

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]



On Wed, 27 Feb 2019, Jerome Glisse wrote:

> 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.

Maybe adding

#define __printf(a,b)

to standard.h will help?

julia

>
> Cheers,
> Jérôme
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

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

* Re: [Cocci] Coccinelle is confuse by extern __printf macro (ie attribute)
  2019-02-28  7:05 ` Julia Lawall
@ 2019-03-08 18:15   ` Jerome Glisse
  0 siblings, 0 replies; 3+ messages in thread
From: Jerome Glisse @ 2019-03-08 18:15 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cocci

On Thu, Feb 28, 2019 at 08:05:31AM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 27 Feb 2019, Jerome Glisse wrote:
> 
> > 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.
> 
> 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
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, other threads:[~2019-03-08 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28  0:43 [Cocci] Coccinelle is confuse by extern __printf macro (ie attribute) Jerome Glisse
2019-02-28  7:05 ` Julia Lawall
2019-03-08 18:15   ` Jerome Glisse

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).