Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* [Cocci] Adjusting SmPL script “tests/nest3.cocci”?
@ 2019-09-11  6:51 Markus Elfring
  2019-09-11  8:28 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-11  6:51 UTC (permalink / raw)
  To: Coccinelle

Hello,

I have taken another look at a script for the semantic patch language.
https://github.com/coccinelle/coccinelle/blob/560c3d02e2085e83e9bcd40842eec7e774140131/tests/nest3.cocci

Can the following code variant be a bit nicer?
(Would you like to avoid the message “warning: rule starting on line 1:
metavariable func not used in the - or context code”?)

@@
identifier f, i;
@@
- int i;
  <... when != i
- for (i = ...; i < ...; i++) f(...);
+ f(1);
  ...>


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

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

* Re: [Cocci] Adjusting SmPL script “tests/nest3.cocci”?
  2019-09-11  6:51 [Cocci] Adjusting SmPL script “tests/nest3.cocci”? Markus Elfring
@ 2019-09-11  8:28 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2019-09-11  8:28 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

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



On Wed, 11 Sep 2019, Markus Elfring wrote:

> Hello,
>
> I have taken another look at a script for the semantic patch language.
> https://github.com/coccinelle/coccinelle/blob/560c3d02e2085e83e9bcd40842eec7e774140131/tests/nest3.cocci
>
> Can the following code variant be a bit nicer?
> (Would you like to avoid the message “warning: rule starting on line 1:
> metavariable func not used in the - or context code”?)

I have dropped the declaration of the metavariable.

julia

>
> @@
> identifier f, i;
> @@
> - int i;
>   <... when != i
> - for (i = ...; i < ...; i++) f(...);
> + f(1);
>   ...>
>
>
> Regards,
> Markus
> _______________________________________________
> 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] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  6:51 [Cocci] Adjusting SmPL script “tests/nest3.cocci”? Markus Elfring
2019-09-11  8:28 ` Julia Lawall

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