[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD()
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD() |
Date: |
Thu, 11 Mar 2021 20:21:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 7/7/20 11:24 PM, Markus Armbruster wrote:
> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> Script adds ERRP_GUARD() macro invocations where appropriate and
> does corresponding changes in code (look for details in
> include/qapi/error.h)
>
> Usage example:
> spatch --sp-file scripts/coccinelle/errp-guard.cocci \
> --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \
> --max-width 80 FILES...
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Message-Id: <20200707165037.1026246-3-armbru@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> [ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
> auto-propagated-errp.cocci to errp-guard.cocci]
> ---
> scripts/coccinelle/errp-guard.cocci | 336 ++++++++++++++++++++++++++++
> include/qapi/error.h | 2 +
> MAINTAINERS | 1 +
> 3 files changed, 339 insertions(+)
> create mode 100644 scripts/coccinelle/errp-guard.cocci
Odd, this script fails on Fedora rawhide:
$ spatch --macro-file scripts/cocci-macro-file.h --sp-file
scripts/coccinelle/errp-guard.cocci --use-gitgrep --dir .
There is no standard.iso in /usr/lib64/coccinelle.
Are you sure you run a properly installed version of spatch
?\ninit_defs_builtins: /usr/lib64/coccinelle/standard.h
init_defs: scripts/cocci-macro-file.h
minus: parse error:
File "scripts/coccinelle/errp-guard.cocci", line 54, column 5, charpos
= 1899
around = '<...',
whole content = <...
$ spatch --version
There is no standard.iso in /usr/lib64/coccinelle.
Are you sure you run a properly installed version of spatch ?\nspatch
version 1.1.0-gc4cc9f6-dirty compiled with OCaml version 4.12.0
Flags passed to the configure script: --build=x86_64-redhat-linux-gnu
--host=x86_64-redhat-linux-gnu --program-prefix=
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--with-python=/usr/bin/python3 --with-menhir=/usr/bin/menhir
OCaml scripting support: yes
Python scripting support: yes
Syntax of regular expressions: PCRE
$ ls /usr/lib64/coccinelle
ocaml spatch standard.h standard.iso
- Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD(),
Philippe Mathieu-Daudé <=