All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Checking the usage of a SmPL disjunction within a sizeof()
@ 2020-08-28 19:32 Markus Elfring
  2020-08-28 19:44 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2020-08-28 19:32 UTC (permalink / raw)
  To: Coccinelle; +Cc: Gustavo A. R. Silva, Kees Cook

Hello,

I have tried another tiny script variant out for the semantic patch language
(according to the software combination “Coccinelle 1.0.8-00159-g730dbb03”).

@display@
identifier array, instance;
type T;
@@
*sizeof( \( T \| *(instance->array) \) )


elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci sizeof-test-20200828.cocci
…
minus: parse error:
  File "sizeof-test-20200828.cocci", line 5, column 17, charpos = 66
  around = '*',
  whole content = *sizeof( \( T \| *(instance->array) \) )


May I expect that such a SmPL disjunction should also work?

Regards,
Markus
_______________________________________________
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] Checking the usage of a SmPL disjunction within a sizeof()
  2020-08-28 19:32 [Cocci] Checking the usage of a SmPL disjunction within a sizeof() Markus Elfring
@ 2020-08-28 19:44 ` Julia Lawall
       [not found]   ` <7d78c522-f0e5-617f-c023-70222093cf80@web.de>
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2020-08-28 19:44 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle, Kees Cook, Gustavo A. R. Silva

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



On Fri, 28 Aug 2020, Markus Elfring wrote:

> Hello,
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00159-g730dbb03”).
>
> @display@
> identifier array, instance;
> type T;
> @@
> *sizeof( \( T \| *(instance->array) \) )
>

No, you can't compbine a type and an expression in a disjunction.

julia

>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci sizeof-test-20200828.cocci
> …
> minus: parse error:
>   File "sizeof-test-20200828.cocci", line 5, column 17, charpos = 66
>   around = '*',
>   whole content = *sizeof( \( T \| *(instance->array) \) )
>
>
> May I expect that such a SmPL disjunction should also work?
>
> 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] 3+ messages in thread

* Re: [Cocci] Usage of a SmPL disjunction with sizeof()
       [not found]   ` <7d78c522-f0e5-617f-c023-70222093cf80@web.de>
@ 2020-08-29  7:48     ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2020-08-29  7:48 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Kees Cook, Coccinelle, Gustavo A. R. Silva



On Sat, 29 Aug 2020, Markus Elfring wrote:

> > No, you can't compbine a type and an expression in a disjunction.
>
> Such an information can be reconsidered once more
> because the following script variant for the semantic patch language
> gets accepted by the Coccinelle software.
>
> @display@
> identifier instance, member;
> type T;
> @@
> *\( sizeof(T) \| sizeof(*(instance->member)) \)

The above is fine.  Both branches of the disjunction are expressions.

julia
_______________________________________________
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:[~2020-08-29  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28 19:32 [Cocci] Checking the usage of a SmPL disjunction within a sizeof() Markus Elfring
2020-08-28 19:44 ` Julia Lawall
     [not found]   ` <7d78c522-f0e5-617f-c023-70222093cf80@web.de>
2020-08-29  7:48     ` [Cocci] Usage of a SmPL disjunction with sizeof() Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.