From 7982612fd5e8ef311a2a58178893f54e6a0601a4 Mon Sep 17 00:00:00 2001 From: pfg Date: Sun, 28 Jan 2018 19:37:30 +0000 Subject: [PATCH] Avoid implicit gcc nonnull attribute in vwarnx(). We removed the nonnull attributes from our headers long ago, but still __printflike() includes it implicitly. This will cause the NULL check to be optimized away in higher -O levels and it will also trigger a -Wnonnull-compare warning. Avoid warning with it in vwarnx(). Obtained from: DragonfLyBSD (git 6329e2f68af73662a1960240675e796ab586bcb1) --- include/err.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/err.h b/include/err.h index 7f0971b2a6df..4b67275a3450 100644 --- a/include/err.h +++ b/include/err.h @@ -60,7 +60,7 @@ void vwarn(const char *, __va_list) __printf0like(1, 0); void warnc(int, const char *, ...) __printf0like(2, 3); void vwarnc(int, const char *, __va_list) __printf0like(2, 0); void warnx(const char *, ...) __printflike(1, 2); -void vwarnx(const char *, __va_list) __printflike(1, 0); +void vwarnx(const char *, __va_list) __printf0like(1, 0); void err_set_file(void *); void err_set_exit(void (* _Nullable)(int)); __END_DECLS