From aa61fdf490d16aaa23de0cbe5e9f16d3bc72e582 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 19 May 2022 15:55:40 -0400 Subject: [PATCH] Give the Coverity scanner some more GCC blinders... Coverity complains: CID 373676 (#3 of 3): Unrecoverable parse warning (PARSE_ERROR) 1. arguments_provided_for_attribute: attribute "__malloc__" does not take arguments This is, of course, just plain wrong. Even so, I'm tired of looking at it, so this patch wraps the #define we use for that attribute in a check to see if it's being built by Coverity. Signed-off-by: Peter Jones --- include/compiler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/compiler.h b/include/compiler.h index 18576724d..b4bf10319 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -47,8 +47,12 @@ #define ALIAS(x) __attribute__((weak, alias (#x))) #endif #ifndef ALLOCFUNC +#if defined(__COVERITY__) +#define ALLOCFUNC(a, b) +#else #define ALLOCFUNC(dealloc, dealloc_arg) __attribute__((__malloc__(dealloc, dealloc_arg))) #endif +#endif #ifndef PRINTF #define PRINTF(first, args...) __attribute__((__format__(printf, first, ## args))) #endif