cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Challenges around asterisk usage in SmPL code
@ 2019-08-24 17:33 Markus Elfring
       [not found] ` <2AE15A09-F219-43DC-81A9-73C13CFC0753@lip6.fr>
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Elfring @ 2019-08-24 17:33 UTC (permalink / raw)
  To: Coccinelle

Hello,

The programming languages “C” and “C++” support functionality where characters
can be ambiguous:
The asterisk can be used for the specification of multiplications
or pointer dereferences (for example).
https://softwareengineering.stackexchange.com/questions/124570/why-pointer-symbol-and-multiplication-sign-are-same-in-c-c

Now I would like to specify a source code search for the case that
unary operations would be used within computations.
The Coccinelle software accepts the following approach.

@assignment@
expression x, y;
@@
* y = ... *(x) ...;


I became curious if another small script for the semantic patch languages
should also work then.

@check@
expression x, y;
statement es;
@@
*if ( \( !(x) \| x == NULL \) )
*   y = ... *(x) ...;
 else
    es


But a parse error is reported so far for this code variant.
How will the software situation evolve further around such challenges?

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

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

end of thread, other threads:[~2019-08-28 11:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-24 17:33 [Cocci] Challenges around asterisk usage in SmPL code Markus Elfring
     [not found] ` <2AE15A09-F219-43DC-81A9-73C13CFC0753@lip6.fr>
2019-08-25  7:40   ` Markus Elfring
2019-08-25  7:48     ` Julia Lawall
2019-08-25  8:13       ` Markus Elfring
2019-08-25  8:30       ` [Cocci] Searching for unary operations with SmPL Markus Elfring
2019-08-25  9:11       ` [Cocci] Challenges around asterisk usage in SmPL code Markus Elfring
2019-08-25  9:45         ` Julia Lawall
2019-08-25 10:22           ` Markus Elfring
2019-08-25 13:13             ` [Cocci] Checking information from “--parse-cocci” Markus Elfring
     [not found]               ` <alpine.DEB.2.21.1908252118210.2801@hadrien>
2019-08-25 13:45                 ` Markus Elfring
     [not found]                   ` <alpine.DEB.2.21.1908252209170.3506@hadrien>
2019-08-25 14:19                     ` Markus Elfring
2019-08-25 17:34           ` [Cocci] Challenges around asterisk usage in SmPL code Markus Elfring
2019-08-26 17:26           ` [Cocci] Checking null pointer handling with SmPL Markus Elfring
2019-08-27  0:58             ` Julia Lawall
2019-08-28 11:50               ` Markus Elfring

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