Coccinelle archive on
 help / color / Atom feed
From: Julia Lawall <>
To: Markus Elfring <>
Cc: Coccinelle <>
Subject: Re: [Cocci] Determination of failure predicates for selected function calls with SmPL?
Date: Wed, 25 Mar 2020 18:32:47 +0100 (CET)
Message-ID: <alpine.DEB.2.21.2003251830510.2306@hadrien> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Wed, 25 Mar 2020, Markus Elfring wrote:

> Hello,
> I have noticed the patch “tty: serial: fsl_lpuart: fix return value checking”.
> I am curious if such a software transformation can be extended for similar
> source code searches also by the means of the semantic patch language.
> The proper knowledge of failure predicates for function calls is a key aspect
> for this use case.
> Would you like to clarify any corresponding development possibilities?

I'm not sure what there is to clarify.  One can surely write rules that
find this kind of problem, with a varying rate of false positives.

A simple approach would be to check all occurrences of if (!ret) for an
integer-typed variable, because typically that is the success case.  But
sometimes people do put the success case under an if.


[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

Cocci mailing list

  reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 17:00 Markus Elfring
2020-03-25 17:32 ` Julia Lawall [this message]
2020-03-25 18:00   ` Markus Elfring
2020-03-26  6:45   ` 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:

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

  git send-email \
    --in-reply-to=alpine.DEB.2.21.2003251830510.2306@hadrien \ \ \ \

* 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

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone