Coccinelle archive on lore.kernel.org
 help / Atom feed
* [Cocci] Can coccinelle differentiate between a string literal and a string variable?
@ 2019-04-16 21:37 Timur Tabi
  2019-04-16 21:48 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2019-04-16 21:37 UTC (permalink / raw)
  To: cocci

I have a macro that requires one of the parameters to be a string
literal, rather than a variable (e.g. char x[] or char *x).

Can a coccinelle rule differentiate between the two?
_______________________________________________
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] Can coccinelle differentiate between a string literal and a string variable?
  2019-04-16 21:37 [Cocci] Can coccinelle differentiate between a string literal and a string variable? Timur Tabi
@ 2019-04-16 21:48 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2019-04-16 21:48 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Tue, 16 Apr 2019, Timur Tabi wrote:

> I have a macro that requires one of the parameters to be a string
> literal, rather than a variable (e.g. char x[] or char *x).
>
> Can a coccinelle rule differentiate between the two?

constant char [] c;

julia

> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>
_______________________________________________
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-04-16 21:37 [Cocci] Can coccinelle differentiate between a string literal and a string variable? Timur Tabi
2019-04-16 21:48 ` 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