From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: cocci@inria.fr, Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [cocci] Checking SmPL test cases?
Date: Sat, 8 Feb 2025 12:58:02 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2502081257090.15422@hadrien> (raw)
In-Reply-To: <6bbdaca7-2fa0-4bdf-bdc7-ba76a5a1d171@web.de>
[-- Attachment #1: Type: text/plain, Size: 1927 bytes --]
On Sat, 8 Feb 2025, Markus Elfring wrote:
> > That seems ... simple enough?
> Can you get further development ideas from test data like the following?
>
> SmPL script example:
> @deletion@
> identifier i;
> @@
> static inline int
> i(...)
> {
> ...
> -if (rnr_elems) {...}
> ...
> }
>
>
> Test result:
> Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> time spatch delete_statement3-Johannes_Berg.cocci test-beacon_len-20250206.c
> …
> diff =
> warning: deletion, node 19: statement[1,2,4,5,7,8] in my_beacon_len may be inconsistently modified
> warning: deletion, node 16: [fortrue][1,2,4,5,7] in my_beacon_len may be inconsistently modified
> warning: deletion, node 15: for[1,2,4,5,7]* in my_beacon_len may be inconsistently modified
> …
> @@ -7,12 +7,5 @@ my_beacon_len(struct cfg80211_mbssid_ele
> {
> int len = 0;
>
> - if (rnr_elems) {
> - u8 i;
> -
> - for (i = 0; i < rnr_elems->cnt; i++)
> - len += rnr_elems->elem[i].len;
> - }
> -
> return len;
> }
>
> real 0m0,058s
> user 0m0,041s
> sys 0m0,016s
>
>
> Another source file example:
> static inline int
> my_beacon_len(struct cfg80211_mbssid_elems *elems,
> struct cfg80211_rnr_elems *rnr_elems,
> u8 i)
> {
> int len = 0;
>
> if (i < elems->cnt) {
> len = elems->elem[i].len;
> if (rnr_elems) {
> len += rnr_elems->elem[i].len;
> for (i = elems->cnt; i < rnr_elems->cnt; i++)
> len += rnr_elems->elem[i].len;
> }
> return len;
> }
>
> return len;
> }
>
>
> Questionable test result:
> Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> time spatch delete_statement3-Johannes_Berg.cocci test2-beacon_len-20250206.c
> …
> real 0m1,653s
> user 0m1,635s
> sys 0m0,017s
>
>
> May I expect the generation of corresponding difference output here?
No. The matched if doesn't occur on every control-flow path.
julia
next prev parent reply other threads:[~2025-02-08 11:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 9:31 [cocci] possible regressions in 1.1.1 -> 1.2 Johannes Berg
2025-02-06 9:48 ` Johannes Berg
2025-02-06 9:53 ` Victor Gambier
2025-02-06 10:00 ` Johannes Berg
2025-02-06 12:36 ` Markus Elfring
2025-02-06 9:59 ` Julia Lawall
2025-02-06 10:07 ` Johannes Berg
2025-02-06 10:12 ` Johannes Berg
2025-02-06 13:34 ` Markus Elfring
2025-02-06 10:13 ` Julia Lawall
2025-02-06 10:17 ` Johannes Berg
2025-02-06 13:46 ` Markus Elfring
2025-02-06 13:00 ` Markus Elfring
2025-02-06 16:50 ` Markus Elfring
2025-02-08 11:26 ` [cocci] Checking SmPL test cases? Markus Elfring
2025-02-08 11:58 ` Julia Lawall [this message]
2025-02-08 12:51 ` Markus Elfring
2025-02-08 14:28 ` Markus Elfring
2025-02-08 15:43 ` Julia Lawall
2025-02-09 8:42 ` Markus Elfring
2025-02-07 7:43 ` [cocci] Checking software run time characteristics Markus Elfring
2025-02-07 7:55 ` Julia Lawall
2025-02-07 8:15 ` Markus Elfring
2025-02-07 8:59 ` Johannes Berg
2025-02-07 9:50 ` Markus Elfring
2025-02-11 9:58 ` [cocci] possible regressions in 1.1.1 -> 1.2 Victor Gambier
2025-02-11 10:33 ` [cocci] Comparing software run time characteristics Markus Elfring
2025-02-12 9:52 ` [cocci] Profiling of SmPL code? Markus Elfring
2026-03-27 10:43 ` [cocci] possible regressions in 1.1.1 -> 1.2 Victor Gambier
2026-03-27 10:49 ` Johannes Berg
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=alpine.DEB.2.22.394.2502081257090.15422@hadrien \
--to=julia.lawall@inria.fr \
--cc=Markus.Elfring@web.de \
--cc=cocci@inria.fr \
--cc=johannes@sipsolutions.net \
/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 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.