1 From 7ccfea413216bddd988823acf4e93421ea0f7f9f Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Tue, 16 Aug 2022 18:35:45 -0700
4 Subject: [PATCH] specify void prototype for functions with no parameters
6 Compilers defaulting to C99 flag such functions as warning which fails
7 to compile when using -Werror
10 error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
12 Upstream-Status: Submitted [https://lists.gnu.org/archive/html/autoconf-patches/2022-08/msg00003.html]
13 Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 lib/autoconf/c.m4 | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
18 --- a/lib/autoconf/c.m4
19 +++ b/lib/autoconf/c.m4
20 @@ -127,7 +127,7 @@ m4_if([$2], [main], ,
21 [/* Override any GCC internal prototype to avoid an error.
22 Use char because int might match the return type of a GCC
23 builtin and then its argument prototype would still apply. */
24 -char $2 ();])], [return $2 ();])])
25 +char $2 (void);])], [return $2 ();])])
28 # AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
29 @@ -151,7 +151,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)],
30 #define $1 innocuous_$1
32 /* System header to define __stub macros and hopefully few prototypes,
33 - which can conflict with char $1 (); below. */
34 + which can conflict with char $1 (void); below. */
38 @@ -162,7 +162,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)],
44 /* The GNU C library defines this for functions which it implements
45 to always fail with ENOSYS. Some functions are actually named
46 something starting with __ and the normal name is an alias. */
47 @@ -252,7 +252,7 @@ dnl other built-in extern "C" functions,
48 dnl when it actually happens.
51 - extern "C" int $2 ();
52 + extern "C" int $2 (void);
54 [[return conftest::$2 ();]])])
56 @@ -2457,7 +2457,7 @@ using std::strcmp;
60 -void test_exception_syntax()
61 +void test_exception_syntax(void)