From 2d8193bd35e9a8e058061ed6b1b5b4591124269b Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:13:44 +0000 Subject: AX_FUNC_SNPRINTF: add missing includes for strcmp(), exit() Clang 16 makes -Wimplicit-function-declaration an error by default. Signed-off-by: Sam James --- m4/ax_func_snprintf.m4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_func_snprintf.m4 b/m4/ax_func_snprintf.m4 index 6fc87d8..b5b78d4 100644 --- a/m4/ax_func_snprintf.m4 +++ b/m4/ax_func_snprintf.m4 @@ -24,7 +24,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AC_FUNC_SNPRINTF], [AX_FUNC_SNPRINTF]) AC_DEFUN([AX_FUNC_SNPRINTF], @@ -32,7 +32,8 @@ AC_DEFUN([AX_FUNC_SNPRINTF], AC_MSG_CHECKING(for working snprintf) AC_CACHE_VAL(ac_cv_have_working_snprintf, [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include - +#include +#include int main(void) { char bufs[5] = { 'x', 'x', 'x', '\0', '\0' }; @@ -51,6 +52,8 @@ AC_MSG_CHECKING(for working vsnprintf) AC_CACHE_VAL(ac_cv_have_working_vsnprintf, [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include #include +#include +#include int my_vsnprintf (char *buf, const char *tmpl, ...) { -- cgit v1.2.1 From fb3d6f750ec628784e7a5da21e9e50d9cef0c80c Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:17:29 +0000 Subject: AX_CHECK_STRFTIME: add missing includes for strcmp() Clang 16 makes -Wimplicit-function-declaration an error by default. Signed-off-by: Sam James --- m4/ax_check_strftime.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/ax_check_strftime.m4 b/m4/ax_check_strftime.m4 index fdf2186..5e7cf33 100644 --- a/m4/ax_check_strftime.m4 +++ b/m4/ax_check_strftime.m4 @@ -19,13 +19,14 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AG_CHECK_STRFTIME], [AX_CHECK_STRFTIME]) AC_DEFUN([AX_CHECK_STRFTIME],[ AC_MSG_CHECKING([whether strftime() works]) AC_CACHE_VAL([ax_cv_strftime],[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#include char t_buf[ 64 ]; int main() { static const char z[] = "Thursday Aug 28 240"; -- cgit v1.2.1 From 84237bcab28bac7f11c63f5fbc8c2d9158d59279 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:18:03 +0000 Subject: AX_FUNC_MEMMOVE: add missing includes for strcmp(), exit() Clang 16 makes -Wimplicit-function-declaration an error by default. Signed-off-by: Sam James --- m4/ax_func_memmove.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/ax_func_memmove.m4 b/m4/ax_func_memmove.m4 index 26ca7c6..b2be366 100644 --- a/m4/ax_func_memmove.m4 +++ b/m4/ax_func_memmove.m4 @@ -20,7 +20,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AC_FUNC_MEMMOVE], [AX_FUNC_MEMMOVE]) AC_DEFUN([AX_FUNC_MEMMOVE], @@ -28,6 +28,8 @@ AC_DEFUN([AX_FUNC_MEMMOVE], AC_MSG_CHECKING(for working memmove) AC_CACHE_VAL(ac_cv_have_working_memmove, [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#include +#include int main(void) { -- cgit v1.2.1 From e72dfe05770de34e096d12bbc035363be40f9830 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:24:38 +0000 Subject: AX_CPU_FREQ: include , for memset(), usleep() Signed-off-by: Sam James --- m4/ax_cpu_freq.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_cpu_freq.m4 b/m4/ax_cpu_freq.m4 index eeb4d5f..c731b2f 100644 --- a/m4/ax_cpu_freq.m4 +++ b/m4/ax_cpu_freq.m4 @@ -19,16 +19,18 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 9 AC_DEFUN([AX_CPU_FREQ], [AC_REQUIRE([AC_PROG_CC]) AC_LANG_PUSH([C++]) AC_CACHE_CHECK(your cpu frequency, ax_cpu_freq, [AC_RUN_IFELSE([AC_LANG_PROGRAM([ +#include #include -#include #include +#include +#include using namespace std; static __inline__ unsigned long long int rdtsc() -- cgit v1.2.1 From 7a608fe3659b428f97760e84c0907cdd1d988b79 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:34:22 +0000 Subject: AX_ADD_FORTIFY_SOURCE: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_add_fortify_source.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_add_fortify_source.m4 b/m4/ax_add_fortify_source.m4 index 7e15312..9d921b8 100644 --- a/m4/ax_add_fortify_source.m4 +++ b/m4/ax_add_fortify_source.m4 @@ -36,7 +36,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 4 +#serial 5 AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ ac_save_cflags=$CFLAGS @@ -57,7 +57,7 @@ AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ AC_LANG_SOURCE([[ #define _FORTIFY_SOURCE 2 #include - int main() { + int main(void) { char *s = " "; strcpy(s, "x"); return strlen(s)-1; -- cgit v1.2.1 From d9e783f7eb235c9d27ed69c8e56cd78a6becd323 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:35:01 +0000 Subject: AX_C99_INLINE: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_c99_inline.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'm4') diff --git a/m4/ax_c99_inline.m4 b/m4/ax_c99_inline.m4 index 6675e02..2a03b8e 100644 --- a/m4/ax_c99_inline.m4 +++ b/m4/ax_c99_inline.m4 @@ -21,7 +21,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 9 AC_DEFUN([AX_C99_INLINE], [ AC_MSG_CHECKING([whether the compiler supports C99 inline functions]) @@ -36,8 +36,8 @@ AC_DEFUN([AX_C99_INLINE], [ dnl translation units that could require the definition. AC_LINK_IFELSE( AC_LANG_SOURCE([ - inline void* foo() { foo(); return &foo; } - int main() { return foo() != 0;} + inline void* foo(void) { foo(); return &foo; } + int main(void) { return foo() != 0;} ]), dnl the invalid source compiled, so the inline keyword does not work @@ -47,8 +47,8 @@ AC_DEFUN([AX_C99_INLINE], [ dnl Secondary test of valid source. AC_LINK_IFELSE( AC_LANG_SOURCE([ - extern inline void* foo() { foo(); return &foo; } - int main() { return foo() != 0;} + extern inline void* foo(void) { foo(); return &foo; } + int main(void) { return foo() != 0;} ]), AC_MSG_RESULT([yes]) -- cgit v1.2.1 From fde70361c2211d7f4c52599b56cc75c4aae98928 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:35:34 +0000 Subject: AX_C_VAR_FUNC: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_c_var_func.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_c_var_func.m4 b/m4/ax_c_var_func.m4 index 4e0e083..8b1e67a 100644 --- a/m4/ax_c_var_func.m4 +++ b/m4/ax_c_var_func.m4 @@ -50,14 +50,14 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 12 +#serial 13 AU_ALIAS([AC_C_VAR_FUNC], [AX_C_VAR_FUNC]) AC_DEFUN([AX_C_VAR_FUNC], [AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], -[[int main() { +[[int main(void) { char *s = __func__; }]])], [ac_cv_c_var_func=yes], -- cgit v1.2.1 From 8a212466702f0ee0f101da245eb7b6a837515784 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:36:04 +0000 Subject: AX_CHECK_POSIX_REGCOMP: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_check_posix_regcomp.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_check_posix_regcomp.m4 b/m4/ax_check_posix_regcomp.m4 index 121734c..72c0bdd 100644 --- a/m4/ax_check_posix_regcomp.m4 +++ b/m4/ax_check_posix_regcomp.m4 @@ -21,7 +21,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AG_CHECK_POSIX_REGCOMP], [AX_CHECK_POSIX_REGCOMP]) AC_DEFUN([AX_CHECK_POSIX_REGCOMP],[ @@ -29,7 +29,7 @@ AC_DEFUN([AX_CHECK_POSIX_REGCOMP],[ AC_CACHE_VAL([ax_cv_posix_regcomp],[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include #include -int main() { +int main(void) { int flags = REG_EXTENDED|REG_ICASE|REG_NEWLINE; regex_t re; if (regcomp( &re, "^.*$", flags ) != 0) -- cgit v1.2.1 From 25ebba451cae86cda8e460b42cdab7c62924d206 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:36:29 +0000 Subject: AX_CHECK_POSIX_SYSINFO: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_check_posix_sysinfo.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_check_posix_sysinfo.m4 b/m4/ax_check_posix_sysinfo.m4 index 0df3873..0b53d16 100644 --- a/m4/ax_check_posix_sysinfo.m4 +++ b/m4/ax_check_posix_sysinfo.m4 @@ -20,14 +20,14 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AG_CHECK_POSIX_SYSINFO], [AX_CHECK_POSIX_SYSINFO]) AC_DEFUN([AX_CHECK_POSIX_SYSINFO],[ AC_MSG_CHECKING([whether sysinfo(2) is POSIX]) AC_CACHE_VAL([ax_cv_posix_sysinfo],[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include -int main() { char z[ 256 ]; +int main(void) { char z[ 256 ]; long sz = sysinfo( SI_SYSNAME, z, sizeof( z )); return (sz > 0) ? 0 : 1; }]])],[ax_cv_posix_sysinfo=yes],[ax_cv_posix_sysinfo=no],[ax_cv_posix_sysinfo=no] ) # end of TRY_RUN]) # end of CACHE_VAL -- cgit v1.2.1 From 8c862a53b7de880eecea95858741614300b8db6b Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 30 Oct 2022 17:36:49 +0000 Subject: AX_CHECK_UNAME_SYSCALL: fix -Wstrict-prototypes Preparation for Clang 16. Signed-off-by: Sam James --- m4/ax_check_uname_syscall.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4') diff --git a/m4/ax_check_uname_syscall.m4 b/m4/ax_check_uname_syscall.m4 index 5a33bfb..d20b526 100644 --- a/m4/ax_check_uname_syscall.m4 +++ b/m4/ax_check_uname_syscall.m4 @@ -19,14 +19,14 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 8 AU_ALIAS([AG_CHECK_UNAME_SYSCALL], [AX_CHECK_UNAME_SYSCALL]) AC_DEFUN([AX_CHECK_UNAME_SYSCALL],[ AC_MSG_CHECKING([whether uname(2) is POSIX]) AC_CACHE_VAL([ax_cv_uname_syscall],[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include -int main() { struct utsname unm; +int main(void) { struct utsname unm; return uname( &unm ); }]])],[ax_cv_uname_syscall=yes],[ax_cv_uname_syscall=no],[ax_cv_uname_syscall=no] ) # end of TRY_RUN]) # end of CACHE_VAL -- cgit v1.2.1