Coccinelle archive on
 help / color / Atom feed
From: Markus Elfring <>
To: Coccinelle <>
Subject: [Cocci] Checking the search for duplicate statements at the end of if branches
Date: Fri, 19 Apr 2019 14:14:53 +0200
Message-ID: <> (raw)
In-Reply-To: <>


I have tried another script out for the evolving semantic patch language.
Source code information is imported into a database table based on
the following SmPL rule.

identifier work;
statement s1, s2;
position pos;
type T;
 T work(...)
 ... when any
 if (...)
 ... when any
 ... when any

I reduced the original source file to a test file which contains almost
only the most interesting code for this analysis approach.

I get an expected test result then.

elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/list_duplicate_statement_pairs_from_if_branches3.cocci netcp_ethss-excerpt3.c
Using SQLAlchemy version:
statement1|statement2|"function name"|"source file"|incidence
of_node_put ( interfaces ) ;|return ret ;|gbe_probe|netcp_ethss-excerpt3.c|2

I reduced the original source file also to a test file which contains
the complete implementation of the function “gbe_probe”.
I get another unexpected test result then.

elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/list_duplicate_statement_pairs_from_if_branches3.cocci netcp_ethss-excerpt5.c
Note: processing took    95.8s: netcp_ethss-excerpt5.c
Duplicate statements were not determined from 1 records.
statement1|statement2|"function name"|"source file"|line
dev_err ( dev , "device tree info unavailable\n" ) ;|return - ENODEV ;|gbe_probe|netcp_ethss-excerpt5.c|12

Now I wonder about this software behaviour.
How are the chances to clarify the shown situation further?

Cocci mailing list

  parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12  9:42 [Cocci] Checking the “display” of last two statements in code blocks Markus Elfring
2019-04-12  9:45 ` Julia Lawall
2019-04-12 10:28   ` Markus Elfring
2019-04-12 10:32     ` Julia Lawall
2019-04-12 10:42       ` [Cocci] Clarification for SmPL asterisk functionality Markus Elfring
2019-04-18 10:00 ` [Cocci] Searching for last two statements in code blocks Markus Elfring
2019-04-19 12:14 ` Markus Elfring [this message]
2019-04-20  7:30   ` [Cocci] Checking execution environment for Python code in SmPL scripts Markus Elfring
2019-04-20  7:35     ` Julia Lawall
2019-04-20  7:51       ` Markus Elfring
2019-04-20  8:05         ` Julia Lawall
2019-04-20  8:11           ` Markus Elfring

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Coccinelle archive on

Archives are clonable:
	git clone --mirror 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/ \
	public-inbox-index cocci

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox