From: Pan Nengyuan <pannengyuan@huawei.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: kuhn.chenqun@huawei.com, cocci@systeme.lip6.fr
Subject: Re: [Cocci] Q: does spatch understand g_autoptr/g_autofree?
Date: Fri, 7 Feb 2020 14:53:40 +0800 [thread overview]
Message-ID: <fd166c80-f6bb-ef94-bf54-e7a63835e015@huawei.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2002070746330.2281@hadrien>
On 2/7/2020 2:48 PM, Julia Lawall wrote:
>
>
> On Fri, 7 Feb 2020, Pan Nengyuan wrote:
>
>> Hello,
>>
>> I have an example:
>>
>> @@ expression d,p; @@
>>
>> - g_autoptr(d) p;
>> + g_autoptr(d) p = NULL;
>>
>> C source code:
>>
>> void f(void)
>> {
>> g_autoptr(Test) *p1;
>> }
>>
>> Then I got this error:
>> minus: parse error:
>> File "test.cocci", line 3, column 15, charpos = 38
>> around = 'p',
>> whole content = - g_autoptr(d) p;
>>
>>
>> is it correct?
>
> No, Coccinelle knows nothing about these things. If you don't care about
> the types of these variables, you can extend standard.h to say
>
> #define g_autoptr(x) int
OK, thanks. I will try it.
>
> julia
> .
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
prev parent reply other threads:[~2020-02-07 6:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 6:26 [Cocci] Q: does spatch understand g_autoptr/g_autofree? Pan Nengyuan
2020-02-07 6:48 ` Julia Lawall
2020-02-07 6:53 ` Pan Nengyuan [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd166c80-f6bb-ef94-bf54-e7a63835e015@huawei.com \
--to=pannengyuan@huawei.com \
--cc=cocci@systeme.lip6.fr \
--cc=julia.lawall@inria.fr \
--cc=kuhn.chenqun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).