From 510145026364c8ec09b20a4e128c6c128c9cc0e5 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 2 Nov 2021 17:32:54 +0100 Subject: [PATCH] scripts: Properly declare g_auto() stub for cocci While being great semantic patching tool, coccinelle fails to understand some of macros we use (including those provided by glib). What they have in common is use of __attribute__ under the hood. We store a list of such macros in a file. But in there, g_auto() macro is not defined properly. Indeed, g_auto(type) declares a local variable of given type, for instance from cocci's POV: g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER; are both the same declaration. Fix declaration of g_auto() stub. Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- scripts/cocci-macro-file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index a76ba533b4..4e6d218a97 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -34,6 +34,6 @@ #define g_autoptr(x) x##_autoptr #define g_autofree -#define g_auto +#define g_auto(x) x #define BAD_CAST