qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD()


From: Markus Armbruster
Subject: Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD()
Date: Fri, 12 Mar 2021 09:36:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> 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 =      <...

Double-checking: it fails only for this script, other scripts work?

>
> $ 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]