From 1c76a075b73b927d54646787fe2feba0b5d7beb9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 6 Apr 2025 21:05:12 +0200 Subject: [PATCH] lib/util: fix NONNULL(params) __attribute__((nonnull(params))) This should be set on the function prototype itself specifying all non null arguments e.g. NONNULL(1) NONNULL(3) int foo(const char *arg1, int arg2, const char *arg3); Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- lib/util/attr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util/attr.h b/lib/util/attr.h index af3e2442b3a..f458a06f01b 100644 --- a/lib/util/attr.h +++ b/lib/util/attr.h @@ -72,9 +72,9 @@ #ifndef NONNULL #if __has_attribute(nonnull) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) ) -#define NONNULL(param) param __attribute__((nonnull)) +#define NONNULL(param) __attribute__((nonnull(param))) #else -#define NONNULL(param) param +#define NONNULL(param) #endif #endif -- 2.47.3