From 888d9ab55012d25059da81fed6575ef3a004726f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 4 Nov 2024 10:26:48 -0800 Subject: [PATCH] configure.ac: enable some -Werror= warnings not included in -W -Wall -pedantic For some reason, these warnings are not included in -W -Wall -pedantic, at least not on gcc 14.2.1: -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations This caused a missing prototype error (because nasm_note[f]() prototypes were missing from include/error.h) to get missed when compiling with --enable-werror, which is ironic at best. Signed-off-by: H. Peter Anvin --- configure.ac | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 77c72be5..354b9c51 100644 --- a/configure.ac +++ b/configure.ac @@ -306,13 +306,17 @@ PA_ARG_ENABLED([werror], PA_ADD_CFLAGS([-Werror=return-type]) PA_ADD_CFLAGS([-Werror=trigraphs]) PA_ADD_CFLAGS([-Werror=pointer-arith]) - PA_ADD_CFLAGS([-Werror=strict-prototypes]) - PA_ADD_CFLAGS([-Werror=missing-prototypes]) - PA_ADD_CFLAGS([-Werror=missing-declarations]) PA_ADD_CFLAGS([-Werror=comment]) PA_ADD_CFLAGS([-Werror=vla])] ) +dnl These warnings are apparently not included in -Wall -W -pedantic +dnl for some bizarre reason. They are, however, absolutely forbidden +dnl in this code base. +PA_ADD_CFLAGS([-Werror=strict-prototypes]) +PA_ADD_CFLAGS([-Werror=missing-prototypes]) +PA_ADD_CFLAGS([-Werror=missing-declarations]) + dnl Variadic macros are used in this code, but only under explicit guard PA_ADD_CFLAGS([-Wvariadic-macros],[-Wno-variadic-macros]) dnl Suppress format warning on Windows targets due to their