cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Coccinelle <cocci@systeme.lip6.fr>
Subject: [Cocci] More precise distinction of types for source code searches?
Date: Mon, 24 Jun 2019 14:51:03 +0200	[thread overview]
Message-ID: <43dc8f93-4c20-32da-f5c2-6f26bc4ef627@web.de> (raw)

Hello,

The semantic patch language supports metavariables.
It can occur then that a source code search should be performed for items
which should be different while they belong still to the same data type.
(If these items would be identical, the software situation would provide
opportunities to simplify corresponding source code.)

The expected difference can trigger the need to express this detail
by the usage of two identifiers based on the same metavariable type.


SmPL script example:
@display@
constant c1, c2;
identifier x;
@@
 x =
*    c1
 ;
 x =
*    c2
 ;


Source file example:
int main(void)
{
int x;
x = 1;
x = 0;
return x;
}


The used constants are integers and additional properties can be expressed
for such numbers. These properties can eventually handled with scripted
SmPL constraints.
But I have got the impression that other metavariable types provide even more
software development challenges for safe distinction of relevant items.

I would like to point the detail out once more that also these metavariables
can be of the same kind then with the consequence that it is not guaranteed
that such metavariables will only match different source code.
The support for the introduction of additional subtypes on demand might be
too limited by the evolving software.

How do you think about this use case?

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

             reply	other threads:[~2019-06-24 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 12:51 Markus Elfring [this message]
2019-06-25 12:40 ` [Cocci] More precise distinction of types for source code searches? Markus Elfring
2019-06-25 14:38   ` Julia Lawall
2019-06-25 17:09     ` Markus Elfring
2019-06-26  8:36     ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43dc8f93-4c20-32da-f5c2-6f26bc4ef627@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).