From 6ad7a7486c3f1e1b907dadd132364fa9e611ccf0 Mon Sep 17 00:00:00 2001 From: Jim DeLaHunt Date: Sat, 29 Jan 2022 01:28:13 -0800 Subject: [PATCH] Eliminate needless -Wimplicit-function-declaration errors on macOS Configuration macro FC_FUNC_VSNPRINTF in m4/vsnprintf.m4 generates a simple C program which uses exit() without #include , and strcmp() without #include . These programs fail to #include , so their use of exit() is implicitly declared. This has been illegal C language since the late 1980's, but tolerated by compilers. However, since 2019, macOS compilers have raised -Wimplicit-function-declaration errors with such constructs. They have good reasons to do so, related to support for ARM instruction sets. Insert `#include ` and `#include ` into this macro in m4/vsnprintf.m4 . Fixes ticket #43737, "Configure scripts give needless -Wimplicit-function-declaration errors on macOS", https://osdn.net/projects/freeciv/ticket/43737 for more information. --- m4/vsnprintf.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 index 87641f7479..282172fae5 100644 --- a/m4/vsnprintf.m4 +++ b/m4/vsnprintf.m4 @@ -14,6 +14,8 @@ AC_DEFUN([FC_FUNC_VSNPRINTF], [ac_cv_func_working_vsnprintf], [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include #include +#include +#include int doit(char * s, ...) -- 2.35.0