Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C520F5513F for ; Sun, 8 Mar 2026 13:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:in-reply-to:message-id:references: mime-version:subject:reply-to:sender:list-id:list-help: list-subscribe:list-unsubscribe:list-post:list-owner: list-archive; bh=lLNk9MFUCl8Zm+Q4HvuEILYe2OTFC/F9MKVOOCMjvs8=; b=tApvE1KftcUpX0bZHSC4HiwF2t5DMrE8JhWg5+MjzMzf9LNQXMnuzPVp WKjBDOH7n+JdW7LWQJHguG4/tSaVCMkgnv4Cy5v3FB18m7l/qpu8foXBe GL7huK977yi6MtRLiPfntWeyhb2ij76XyQw7c75kxMdM9vtHlGP5Fgm3D k=; X-CSE-ConnectionGUID: 016iUdC+RUOCGVeM8BCSKA== X-CSE-MsgGUID: qHLYarinRJ6Jtb1i3r/FZg== Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=cocci-owner@inria.fr; spf=None smtp.helo=postmaster@prod-sympa-app.inria.fr Received-SPF: SoftFail (mail2-relais-roc.national.inria.fr: domain of cocci-owner@inria.fr is inclined to not designate 128.93.162.27 as permitted sender) identity=mailfrom; client-ip=128.93.162.27; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="cocci-owner@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 include:mailout.safebrands.com a:basic-mail.safebrands.com a:basic-mail01.safebrands.com a:basic-mail02.safebrands.com ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:128.93.162.3 ip4:128.93.162.88 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@prod-sympa-app.inria.fr) identity=helo; client-ip=128.93.162.27; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="postmaster@prod-sympa-app.inria.fr"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.23,108,1770591600"; d="scan'208";a="266737648" Received: from prod-sympa-app.inria.fr ([128.93.162.27]) by mail2-relais-roc.national.inria.fr with ESMTP; 08 Mar 2026 14:24:59 +0100 Received: by prod-sympa-app.inria.fr (Postfix, from userid 990) id 48B5F80E86; Sun, 8 Mar 2026 14:24:58 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by prod-sympa-app.inria.fr (Postfix) with ESMTP id 34195804B6 for ; Sun, 8 Mar 2026 14:24:54 +0100 (CET) X-CSE-ConnectionGUID: hCwvRvZjRayOREiUR4c7Yw== X-CSE-MsgGUID: UPUsr0mqQBmpL2rpUqjxiw== X-IronPort-AV: E=Sophos;i="6.23,108,1770591600"; d="scan'208";a="140717031" Received: from 88-188-149-159.subs.proxad.net (HELO hadrien) ([88.188.149.159]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2026 14:24:54 +0100 Date: Sun, 8 Mar 2026 14:24:53 +0100 (CET) From: Julia Lawall To: Markus Elfring cc: cocci@inria.fr In-Reply-To: <20a815aa-5fa9-4b34-ab81-d6985ed193c0@web.de> Message-ID: References: <349a12a9-f70d-4c8f-a730-9f8ec90b593f@web.de> <20a815aa-5fa9-4b34-ab81-d6985ed193c0@web.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1026211301-1772976294=:3947" Subject: Re: [cocci] Reconsidering source code search challenges for nested compound statements Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 3329 Errors-To: cocci-owner@inria.fr Precedence: list Precedence: bulk Sender: cocci-request@inria.fr X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1026211301-1772976294=:3947 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 8 Mar 2026, Markus Elfring wrote: > > I constructed another source file example together with a corresponding SmPL script. > > @display@ > statement list sl; > @@ > *{ sl } > > > Compound statements are often used in known programming languages. > https://en.cppreference.com/w/c/language/statements.html#Compound_statements > > Another test result: > Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> /usr/bin/spatch test-item_assignments.c ../janitor/show_compound_statements.cocci > … > @@ -3,9 +3,6 @@ void my_test(void) > int item; > > if (1) > - { > - item = 1; > - } > > item = 2; > } > > > The source code search pattern looks promising (in principle). > But it can be ambiguous in its minimal form. > Thus further case distinctions would occasionally be helpful. > > Additional context information can become relevant then. > How would you prefer to handle control flow recursion in safer ways here? I have no idea what result you would like to see. The whole point of Coccinelle is that if some context information should be taken into account, then you can provide it. julia > > Regards, > Markus > --8323329-1026211301-1772976294=:3947--