From 4fa0a84c9432b679a89f59282b51774ed2fe56af Mon Sep 17 00:00:00 2001 From: Quinn Date: Sat, 23 Aug 2025 23:01:01 +0200 Subject: [PATCH] fix attributes with parameters to be less messy due to vardiac arguments --- src/util/atrb.h | 8 ++++---- src/util/conf.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/atrb.h b/src/util/atrb.h index 9b672a4..2fa33a5 100644 --- a/src/util/atrb.h +++ b/src/util/atrb.h @@ -46,14 +46,14 @@ #endif #if __has_attribute(__format__) -#define FORMAT(...) __attribute__((format(__VA_ARGS__))) +#define FORMAT(args) __attribute__((format args)) #else -#define FORMAT(...) +#define FORMAT(args) #endif #if __has_attribute(__nonnull__) -#define NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) +#define NONNULL(args) __attribute__((__nonnull__ args)) #else -#define NONNULL(...) +#define NONNULL(args) #endif #endif diff --git a/src/util/conf.c b/src/util/conf.c index df10c4a..6589e0d 100644 --- a/src/util/conf.c +++ b/src/util/conf.c @@ -127,7 +127,7 @@ int conf_procval(struct conf_entry const *opt, const char *restrict val) { } /* utility function for conf_getpat to concatenate 3 strings, where we already know the size */ -NONNULL(1, 3) +NONNULL((1, 3)) static char *conf_getpat_concat(const char *restrict s1, const char *restrict s2, const char *restrict s3, size_t s1len, size_t s2len, size_t s3len) { assert(s2 || (!s2 && !s2len)); // ensuring the programmer passes both s2 and s2len as 0, if they intend to char *buf, *ptr;