]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/util: fix NONNULL(params) __attribute__((nonnull(params)))
authorStefan Metzmacher <metze@samba.org>
Sun, 6 Apr 2025 19:05:12 +0000 (21:05 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Apr 2025 10:17:29 +0000 (10:17 +0000)
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 <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/util/attr.h

index af3e2442b3ad7edb40b0b650f5250223c16745b9..f458a06f01b8b54dab2a34bca6360b641ad70c64 100644 (file)
@@ -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