Coccinelle archive on lore.kernel.org
 help / 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, back to index

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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox