Q: does spatch understand g_autoptr/g_autofree?
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?
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 16 lines · Pan Nengyuan
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; }
Quoted 8 lines
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
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 27 lines · Julia Lawall
Quoted 23 lines · Pan Nengyuan
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;
Quoted 6 lines
Quoted 1 line
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.hto say#define
g_autoptr(x)int
OK, thanks. I will try it.
Quoted 4 lines
julia
.
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci