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: Philippe Mathieu-Daudé
Subject: Re: [PULL 47/53] scripts: Coccinelle script to use ERRP_GUARD()
Date: Fri, 12 Mar 2021 11:17:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 3/12/21 9:36 AM, Markus Armbruster wrote:
> 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?

Ah good point, this is the first one I checked...
I'll see with the others and update.




reply via email to

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