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 B5D18CA1002 for ; Sat, 6 Sep 2025 12:51:44 +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=qc1ad44JtqALwCwFhZKW2pyHNUJsZIta8sjhe0o5ipk=; b=li5y3or5+OJ2zWqLZvytEcpNscgRiwLRRTRMvBjqgk6viGCChuTcrGNy hL/YEtxehwEfJ+lGhstEC5Op2kKmfliUAOUPCGf+VNY58kpnCKi06ul7C NkFA4uqYIwjRY8KJu2ALj7UfR1cLKInrVVw2JPCobBdSbLYfjLw9fkXvv w=; X-CSE-ConnectionGUID: xgJtWdbHRi2tVQ8YWHkf3A== X-CSE-MsgGUID: hgtGd7x8TxiUyftOTdiDVQ== Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of cocci-owner@inria.fr designates 128.93.162.160 as permitted sender) identity=mailfrom; client-ip=128.93.162.160; 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@sympa.inria.fr) identity=helo; client-ip=128.93.162.160; receiver=mail2-relais-roc.national.inria.fr; envelope-from="cocci-owner@inria.fr"; x-sender="postmaster@sympa.inria.fr"; x-conformance=spf_only Authentication-Results: mail2-relais-roc.national.inria.fr; spf=Pass smtp.mailfrom=cocci-owner@inria.fr; spf=None smtp.helo=postmaster@sympa.inria.fr; dkim=pass (signature verified) header.i=@inria.fr X-IronPort-AV: E=Sophos;i="6.18,244,1751234400"; d="scan'208";a="237814836" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 06 Sep 2025 14:51:43 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 1209CE0BE9; Sat, 6 Sep 2025 14:51:43 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4DFAEE0171 for ; Sat, 6 Sep 2025 14:51:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=qc1ad44JtqALwCwFhZKW2pyHNUJsZIta8sjhe0o5ipk=; b=gF/Il34L9pJkzlh0PaDZYoqzU6b9TgjHFuKmOBEK0GAx4/QEus+SbwDr b5mTyBo94fQFJJgvBxvYfFq2Y28yKkqDD7bFXJxJKGOxWHOaYPwdOxvta iVAIWBTH2BTCGs5qVnNEeI0utA0EePWPK+NIiKH6aG3VKWTPtc7lDVKs+ E=; X-CSE-ConnectionGUID: LhUMZJTHSC++b6jGDZjX8A== X-CSE-MsgGUID: KZ3Fr5VOSeqFGmCFrd0TpA== X-IronPort-AV: E=Sophos;i="6.18,244,1751234400"; d="scan'208";a="237814835" Received: from 231.85.89.92.rev.sfr.net (HELO hadrien) ([92.89.85.231]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2025 14:51:37 +0200 Date: Sat, 6 Sep 2025 14:51:36 +0200 (CEST) From: Julia Lawall To: Markus Elfring cc: cocci@inria.fr In-Reply-To: <625e0ed7-6b00-4288-9484-a23e144b7a2c@web.de> Message-ID: References: <6c2e0db1-033f-4f66-9cf7-dc0eae4bcde7@web.de> <4c46da9-1fa9-9b4f-f0c7-6c7fd094e163@inria.fr> <13ed7845-6fd9-4a8e-9670-3d2b7e7a0f4e@web.de> <4959806f-e03e-9a59-63eb-f71b6bf6f954@inria.fr> <469a978c-5b6f-4cfd-99c6-69671de653ad@web.de> <360bb5e1-9a03-42dd-a009-818021ade0a3@web.de> <625e0ed7-6b00-4288-9484-a23e144b7a2c@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [cocci] Searching for selected variable assignments (with SmPL)? Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 3010 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: On Sat, 6 Sep 2025, Markus Elfring wrote: > >>>>>> *;@place > >>> > >>> This line certainly doesn't work. It is searching for an empty statement > >> > >> I would like to interpret it in the way that there is an end of a known statement. > >> > >> > >>> at a place where there is an assignment statement. > >> > >> The first SmPL rule determined that this can not be empty. > >> Is it possible to avoid duplicated SmPL code here? > > > > You can put an expression metavariable e. But you can't put nothing. > > Thanks for this information. > > Can such a data processing constraint be reconsidered? No. Here as elsewhere Coccinelle works on complete things - complete statement, complete expression, complete loop header. It doesn't work on random fragments of code that you may find convenient. So a ; on a line by itself is interpreted as a complete statement, hence and empty statement. julia > > @find@ > expression e; > position place; > type t; > t * pointer; > @@ > pointer = e(...);@place > > @display@ > expression x; > position find.place; > statement s; > type find.t; > t * find.pointer; > @@ > *x;@place > if (!pointer) > s > ... when != pointer > > > Regards, > Markus >