Paul Eggert wrote: > static void > -init_sh_quoting_options () > +init_sh_quoting_options (void) > {
Your change prompted me to wonder whether this patch should be generalized, that is, whether all function definitions with empty parameter lists should be changed to use this style. Like in the attached patch. I got doubts because * I'm using the style with () in function definitions in many places, and neither 'gcc -Wall' nor 'clang -Wall' has warned about it, in many years. * The ISO C committee attempts to align C with C++ (e.g. regarding the attributes syntax), and in C++ a function declaration or definition with () denotes zero arguments. There were two essential changes in this area in ISO C 23: * https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf 1) removed the K&R C syntax for function definitions int foo (x, y) int x; long y; { ... } 2) in function definitions, () is equivalent to (void). * https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm 3) A function declarator with a parameter list of () declares a prototype for a function that takes no parameters (like it does in C++). See ISO C 23 ยง 6.7.6.3.(13). For those of us that are not standards experts, the effects can be seen through two test cases, with clang 15.0.6. =================================== foo1.c =================================== #include <stdio.h> void func(); int main() { func("AAA"); return 0; } void func() { printf("in func()\n"); } =================================== foo2.c =================================== #include <stdio.h> void func() { printf("in func()\n"); } int main() { func("AAA"); return 0; } ============================================================================== clang diagnostics for older standard versions: $ clang -Wall foo1.c foo1.c:6:9: warning: passing arguments to 'func' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] func("AAA"); ^ 1 warning generated. $ clang -Wall foo2.c foo2.c:8:15: warning: too many arguments in call to 'func' func("AAA"); ~~~~ ^ foo2.c:8:9: warning: passing arguments to 'func' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] func("AAA"); ^ 2 warnings generated. clang diagnostics for C23: $ clang -std=gnu2x -Wall foo1.c foo1.c:6:10: error: too many arguments to function call, expected 0, have 1 func("AAA"); ~~~~ ^~~~~ foo1.c:3:6: note: 'func' declared here void func(); ^ 1 error generated. $ clang -std=gnu2x -Wall foo2.c foo2.c:8:10: error: too many arguments to function call, expected 0, have 1 func("AAA"); ~~~~ ^~~~~ foo2.c:3:6: note: 'func' declared here void func() { ^ 1 error generated. What does this mean? (I) In function *definitions*, () and (void) mean the same: zero arguments. This was always the case, in C89, in K&R C, and equally in C++. (II) Regarding function *declarations*, this gives a whole new view of the history. * In C23, () and (void) mean the same: zero arguments. It's like this in C++ as well, for many years. * The (void) syntax was only introduced as a temporary workaround, as long as - in C only, not in C++ - () in function declarations meant a varargs list: (...). * The GCC warning -Wstrict-prototypes is a migration aid, whose purpose is to remind the programmer to convert declarations such as void func (); to either void func (void); or void func (first_t arg, ...); Unfortunately, this GCC warning also warns about function definitions void func () { ... } although there was never a need to warn about these; see (I) above. (III) So, why is (void) allowed in function *definitions* at all? I can only guess: - Maybe the future standardization path of this area was not clear in 1989. (For instance, C++ did not exist at that time, and nowadays ISO C is following ISO C++ in some aspects.) - There was the desire to have the same syntax across function declarations/types and function definitions. Now, how should we go ahead in this situation? This is my opinion: * In the long term, assuming ISO C 23 and newer, writing (void) is just clutter in those places where one can just as well write (). The keyword 'void' here only tells that the programmer has accomplished the migration from K&R C to ISO C 23, nothing else. * We can assume that the readers and contributors of our code know the difference between a function declaration/type and a function definition. Therefore, I'm in favour of turning all (void) in function *definitions* to (). This can happen now or any time. * We should stop compiling with -Wstrict-prototypes and instead (not always, but frequently enough) compile with the '-std=gnu23' option. Clang currently implements it better. GCC 13 may be on par with clang again on this topic [1]. * We need to continue to use (void) in function declarations/types, as long as we support compilers for ISO C standards before C 23. This will probably take 10 or 15 years. Bruno [1] https://gcc.gnu.org/gcc-13/changes.html
diff --git a/lib/clean-temp.c b/lib/clean-temp.c index de16292b36..2b1b347ee6 100644 --- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -500,7 +500,7 @@ cleanup_temp_dir (struct temp_dir *dir) So we cache the info whether we are running on Windows NT or newer. */ static bool -supports_delete_on_close () +supports_delete_on_close (void) { static int known; /* 1 = yes, -1 = no, 0 = unknown */ if (!known) diff --git a/lib/math.in.h b/lib/math.in.h index 70b75e2399..09e1ac3fa0 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -169,7 +169,7 @@ static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq; choke on the expression 0.0 / 0.0. */ # if defined __DECC || defined _MSC_VER _GL_MATH_INLINE float -_NaN () +_NaN (void) { static float zero = 0.0f; return zero / zero; diff --git a/lib/relocatable.c b/lib/relocatable.c index ac12c6da39..3e8a48206e 100644 --- a/lib/relocatable.c +++ b/lib/relocatable.c @@ -400,7 +400,7 @@ _DLL_InitTerm (unsigned long hModule, unsigned long ulFlag) #else /* Unix */ static void -find_shared_library_fullname () +find_shared_library_fullname (void) { #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__ /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline() @@ -458,7 +458,7 @@ find_shared_library_fullname () Return NULL if unknown. Guaranteed to work only on Linux, EMX, Cygwin, and native Windows. */ static char * -get_shared_library_fullname () +get_shared_library_fullname (void) { #if !(defined _WIN32 && !defined __CYGWIN__) && !defined __EMX__ static bool tried_find_shared_library_fullname; diff --git a/lib/relocwrapper.c b/lib/relocwrapper.c index b77b5a99fa..3018fa2e21 100644 --- a/lib/relocwrapper.c +++ b/lib/relocwrapper.c @@ -145,7 +145,7 @@ static_assert (sizeof (libdirs) / sizeof (libdirs[0]) > 1); /* Relocate the list of directories that contain the libraries. */ static void -relocate_libdirs () +relocate_libdirs (void) { size_t i; @@ -155,7 +155,7 @@ relocate_libdirs () /* Activate the list of directories in the LIBPATHVAR. */ static void -activate_libdirs () +activate_libdirs (void) { const char *old_value; size_t total; diff --git a/lib/term-style-control.c b/lib/term-style-control.c index 44074a84ac..6ea5b1ebca 100644 --- a/lib/term-style-control.c +++ b/lib/term-style-control.c @@ -546,7 +546,7 @@ static sigset_t relevant_signal_set; static bool relevant_signal_set_initialized = false; static void -init_relevant_signal_set () +init_relevant_signal_set (void) { if (!relevant_signal_set_initialized) { @@ -570,7 +570,7 @@ init_relevant_signal_set () /* Temporarily delay the relevant signals. */ static _GL_ASYNC_SAFE inline void -block_relevant_signals () +block_relevant_signals (void) { /* The caller must ensure that init_relevant_signal_set () was already called. */ @@ -582,7 +582,7 @@ block_relevant_signals () /* Stop delaying the relevant signals. */ static _GL_ASYNC_SAFE inline void -unblock_relevant_signals () +unblock_relevant_signals (void) { sigprocmask (SIG_UNBLOCK, &relevant_signal_set, NULL); } diff --git a/lib/timevar.c b/lib/timevar.c index 765f806f2f..62c91211bc 100644 --- a/lib/timevar.c +++ b/lib/timevar.c @@ -141,7 +141,7 @@ timevar_accumulate (struct timevar_time_def *timer, } void -timevar_init () +timevar_init (void) { if (!timevar_enabled) return; diff --git a/lib/tmpfile.c b/lib/tmpfile.c index 419f9ffe40..1b9bce0e38 100644 --- a/lib/tmpfile.c +++ b/lib/tmpfile.c @@ -66,7 +66,7 @@ So we cache the info whether we are running on Windows NT or newer. */ static bool -supports_delete_on_close () +supports_delete_on_close (void) { static int known; /* 1 = yes, -1 = no, 0 = unknown */ if (!known) diff --git a/lib/unistd.in.h b/lib/unistd.in.h index bfc501e5a7..dd15442cf6 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1431,7 +1431,7 @@ _GL_FUNCDECL_SYS (getpagesize, int, (void)); # else # if !GNULIB_defined_getpagesize_function _GL_UNISTD_INLINE int -getpagesize () +getpagesize (void) { return _gl_getpagesize (); } diff --git a/m4/isnanf.m4 b/m4/isnanf.m4 index 01f7bbd20d..936779b0fb 100644 --- a/m4/isnanf.m4 +++ b/m4/isnanf.m4 @@ -1,4 +1,4 @@ -# isnanf.m4 serial 18 +# isnanf.m4 serial 19 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -137,7 +137,7 @@ AC_DEFUN([gl_ISNANF_WORKS], /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */ #ifdef __DECC static float -NaN () +NaN (void) { static float zero = 0.0f; return zero / zero; diff --git a/m4/mktime.m4 b/m4/mktime.m4 index e9d31f35a4..765e05e5cf 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,4 +1,4 @@ -# serial 37 +# serial 38 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -73,7 +73,7 @@ static char *tz_strings[] = { /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int -spring_forward_gap () +spring_forward_gap (void) { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; @@ -111,7 +111,7 @@ mktime_test (time_t now) } static int -irix_6_4_bug () +irix_6_4_bug (void) { /* Based on code from Ariel Faigon. */ struct tm tm; @@ -153,7 +153,7 @@ bigtime_test (int j) } static int -year_2050_test () +year_2050_test (void) { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ @@ -184,7 +184,7 @@ year_2050_test () } static int -indiana_test () +indiana_test (void) { if (putenv ("TZ=America/Indiana/Indianapolis") != 0) return -1; diff --git a/m4/printf.m4 b/m4/printf.m4 index 4e65abc6e6..5d867b8bc7 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 73 +# printf.m4 serial 74 dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -191,7 +191,7 @@ strisnan (const char *string, size_t start_index, size_t end_index) return 0; } static int -have_minus_zero () +have_minus_zero (void) { static double plus_zero = 0.0; double minus_zero = - plus_zero; diff --git a/tests/infinity.h b/tests/infinity.h index ebe9df3c40..ead6908706 100644 --- a/tests/infinity.h +++ b/tests/infinity.h @@ -22,7 +22,7 @@ PGI 16.10 complains. */ #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI static float -Infinityf () +Infinityf (void) { static float zero = 0.0f; return 1.0f / zero; @@ -39,7 +39,7 @@ Infinityf () PGI 16.10 complains. */ #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI static double -Infinityd () +Infinityd (void) { static double zero = 0.0; return 1.0 / zero; @@ -56,7 +56,7 @@ Infinityd () PGI 16.10 complains. */ #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI static long double -Infinityl () +Infinityl (void) { static long double zero = 0.0L; return 1.0L / zero; diff --git a/tests/nan.h b/tests/nan.h index 05f141d2a9..7a453870d8 100644 --- a/tests/nan.h +++ b/tests/nan.h @@ -31,7 +31,7 @@ || (defined __MVS__ && defined __IBMC__) \ || defined __PGI) static float -NaNf () +NaNf (void) { static float zero = 0.0f; return zero / zero; @@ -50,7 +50,7 @@ NaNf () || (defined __MVS__ && defined __IBMC__) \ || defined __PGI) static double -NaNd () +NaNd (void) { static double zero = 0.0; return zero / zero; @@ -75,7 +75,7 @@ static long double NaNl () } #elif defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI static long double -NaNl () +NaNl (void) { static long double zero = 0.0L; return zero / zero; diff --git a/tests/test-cnd.c b/tests/test-cnd.c index d7fcaba649..fe72d75dbb 100644 --- a/tests/test-cnd.c +++ b/tests/test-cnd.c @@ -79,7 +79,7 @@ cnd_wait_routine (void *arg) } static void -test_cnd_wait () +test_cnd_wait (void) { struct timespec remain; thrd_t thread; diff --git a/tests/test-cond.c b/tests/test-cond.c index 6f2cf97b21..3560cd39a2 100644 --- a/tests/test-cond.c +++ b/tests/test-cond.c @@ -79,7 +79,7 @@ cond_routine (void *arg) } static void -test_cond () +test_cond (void) { int remain = 2; gl_thread_t thread; diff --git a/tests/test-idpriv-drop.c b/tests/test-idpriv-drop.c index c367259b95..fb1f16b12a 100644 --- a/tests/test-idpriv-drop.c +++ b/tests/test-idpriv-drop.c @@ -26,7 +26,7 @@ #include "macros.h" static void -show_uids () +show_uids (void) { #if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */ uid_t real; @@ -45,7 +45,7 @@ show_uids () } static void -show_gids () +show_gids (void) { #if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */ gid_t real; diff --git a/tests/test-idpriv-droptemp.c b/tests/test-idpriv-droptemp.c index 9fa19fd126..92fe2f2aa8 100644 --- a/tests/test-idpriv-droptemp.c +++ b/tests/test-idpriv-droptemp.c @@ -26,7 +26,7 @@ #include "macros.h" static void -show_uids () +show_uids (void) { #if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */ uid_t real; @@ -45,7 +45,7 @@ show_uids () } static void -show_gids () +show_gids (void) { #if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */ gid_t real; diff --git a/tests/test-isfinite.c b/tests/test-isfinite.c index edb5f43327..08b29839af 100644 --- a/tests/test-isfinite.c +++ b/tests/test-isfinite.c @@ -37,7 +37,7 @@ double zerod = 0.0; long double zerol = 0.0L; static void -test_isfinitef () +test_isfinitef (void) { /* Zero. */ ASSERT (isfinite (0.0f)); @@ -81,7 +81,7 @@ test_isfinitef () } static void -test_isfinited () +test_isfinited (void) { /* Zero. */ ASSERT (isfinite (0.0)); @@ -123,7 +123,7 @@ test_isfinited () } static void -test_isfinitel () +test_isfinitel (void) { #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) diff --git a/tests/test-isinf.c b/tests/test-isinf.c index f1bca0ce10..4b76e3aaad 100644 --- a/tests/test-isinf.c +++ b/tests/test-isinf.c @@ -37,7 +37,7 @@ double zerod = 0.0; long double zerol = 0.0L; static void -test_isinff () +test_isinff (void) { /* Zero. */ ASSERT (!isinf (0.0f)); @@ -83,7 +83,7 @@ test_isinff () } static void -test_isinfd () +test_isinfd (void) { /* Zero. */ ASSERT (!isinf (0.0)); @@ -127,7 +127,7 @@ test_isinfd () } static void -test_isinfl () +test_isinfl (void) { #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) diff --git a/tests/test-obstack-printf.c b/tests/test-obstack-printf.c index 71d5f9db3f..182c3260ec 100644 --- a/tests/test-obstack-printf.c +++ b/tests/test-obstack-printf.c @@ -115,13 +115,13 @@ my_obstack_printf (struct obstack *obs, const char *format, ...) } static void -test_obstack_vprintf () +test_obstack_vprintf (void) { test_function (my_obstack_printf); } static void -test_obstack_printf () +test_obstack_printf (void) { test_function (obstack_printf); } diff --git a/tests/test-poll.c b/tests/test-poll.c index 716c38b492..5e98c4ee70 100644 --- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -84,7 +84,7 @@ test (void (*fn) (void), const char *msg) /* Funny socket code. */ static int -open_server_socket () +open_server_socket (void) { int s, x; struct sockaddr_in ia; diff --git a/tests/test-pthread-cond.c b/tests/test-pthread-cond.c index f45d8b69c8..6310fcb071 100644 --- a/tests/test-pthread-cond.c +++ b/tests/test-pthread-cond.c @@ -84,7 +84,7 @@ pthread_cond_wait_routine (void *arg) } static void -test_pthread_cond_wait () +test_pthread_cond_wait (void) { struct timespec remain; pthread_t thread; diff --git a/tests/test-signbit.c b/tests/test-signbit.c index 49083c2c9a..37ccf346e4 100644 --- a/tests/test-signbit.c +++ b/tests/test-signbit.c @@ -37,7 +37,7 @@ double zerod = 0.0; long double zerol = 0.0L; static void -test_signbitf () +test_signbitf (void) { /* Finite values. */ ASSERT (!signbit (3.141f)); @@ -82,7 +82,7 @@ test_signbitf () } static void -test_signbitd () +test_signbitd (void) { /* Finite values. */ ASSERT (!signbit (3.141)); @@ -125,7 +125,7 @@ test_signbitd () } static void -test_signbitl () +test_signbitl (void) { /* Finite values. */ ASSERT (!signbit (3.141L)); diff --git a/tests/test-snprintf-posix.h b/tests/test-snprintf-posix.h index 4db76deb75..3e61f28b6e 100644 --- a/tests/test-snprintf-posix.h +++ b/tests/test-snprintf-posix.h @@ -22,7 +22,7 @@ /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int -have_minus_zero () +have_minus_zero (void) { static double plus_zero = 0.0; double minus_zero = minus_zerod; diff --git a/tests/test-sprintf-posix.h b/tests/test-sprintf-posix.h index 979254acc7..06ae80e763 100644 --- a/tests/test-sprintf-posix.h +++ b/tests/test-sprintf-posix.h @@ -22,7 +22,7 @@ /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int -have_minus_zero () +have_minus_zero (void) { static double plus_zero = 0.0; double minus_zero = minus_zerod; diff --git a/tests/test-vasnprintf-posix.c b/tests/test-vasnprintf-posix.c index 4a83f6d243..1e3e45363a 100644 --- a/tests/test-vasnprintf-posix.c +++ b/tests/test-vasnprintf-posix.c @@ -36,7 +36,7 @@ /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int -have_minus_zero () +have_minus_zero (void) { static double plus_zero = 0.0; double minus_zero = minus_zerod; @@ -4001,13 +4001,13 @@ my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } static void -test_asnprintf () +test_asnprintf (void) { test_function (asnprintf); } diff --git a/tests/test-vasnprintf-posix3.c b/tests/test-vasnprintf-posix3.c index ad2d8d6460..f97a758248 100644 --- a/tests/test-vasnprintf-posix3.c +++ b/tests/test-vasnprintf-posix3.c @@ -61,13 +61,13 @@ my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } static void -test_asnprintf () +test_asnprintf (void) { test_function (asnprintf); } diff --git a/tests/test-vasnprintf.c b/tests/test-vasnprintf.c index 635654bb13..5f7107fd93 100644 --- a/tests/test-vasnprintf.c +++ b/tests/test-vasnprintf.c @@ -101,13 +101,13 @@ my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } static void -test_asnprintf () +test_asnprintf (void) { test_function (asnprintf); } diff --git a/tests/test-vasprintf-posix.c b/tests/test-vasprintf-posix.c index 8563502c47..08f0d65504 100644 --- a/tests/test-vasprintf-posix.c +++ b/tests/test-vasprintf-posix.c @@ -35,7 +35,7 @@ /* The SGI MIPS floating-point format does not distinguish 0.0 and -0.0. */ static int -have_minus_zero () +have_minus_zero (void) { static double plus_zero = 0.0; double minus_zero = minus_zerod; @@ -3929,13 +3929,13 @@ my_asprintf (char **result, const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { test_function (my_asprintf); } static void -test_asprintf () +test_asprintf (void) { test_function (asprintf); } diff --git a/tests/test-vasprintf.c b/tests/test-vasprintf.c index 017aa5e7bf..c9f9f5f53d 100644 --- a/tests/test-vasprintf.c +++ b/tests/test-vasprintf.c @@ -43,7 +43,7 @@ my_asprintf (char **result, const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { int repeat; @@ -69,7 +69,7 @@ test_vasprintf () } static void -test_asprintf () +test_asprintf (void) { int repeat; diff --git a/tests/uniname/test-uninames.c b/tests/uniname/test-uninames.c index 29d59a534c..ef31362284 100644 --- a/tests/uniname/test-uninames.c +++ b/tests/uniname/test-uninames.c @@ -196,7 +196,7 @@ name_has_alias (unsigned int uc) /* Perform an exhaustive test of the unicode_character_name function. */ static int -test_name_lookup () +test_name_lookup (void) { int error = 0; unsigned int i; @@ -248,7 +248,7 @@ test_name_lookup () /* Perform a test of the unicode_name_character function. */ static int -test_inverse_lookup () +test_inverse_lookup (void) { int error = 0; unsigned int i; @@ -330,7 +330,7 @@ test_inverse_lookup () /* Perform a test of the unicode_name_character function for aliases. */ static int -test_alias_lookup () +test_alias_lookup (void) { int error = 0; unsigned int i; diff --git a/tests/unistdio/test-u16-asnprintf1.c b/tests/unistdio/test-u16-asnprintf1.c index f556716c62..872207390c 100644 --- a/tests/unistdio/test-u16-asnprintf1.c +++ b/tests/unistdio/test-u16-asnprintf1.c @@ -33,7 +33,7 @@ #include "test-u16-asnprintf1.h" static void -test_asnprintf () +test_asnprintf (void) { test_function (u16_asnprintf); } diff --git a/tests/unistdio/test-u16-vasnprintf1.c b/tests/unistdio/test-u16-vasnprintf1.c index 337befc43b..2e9845ac61 100644 --- a/tests/unistdio/test-u16-vasnprintf1.c +++ b/tests/unistdio/test-u16-vasnprintf1.c @@ -61,7 +61,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); test_xfunction (my_xasprintf); diff --git a/tests/unistdio/test-u16-vasnprintf2.c b/tests/unistdio/test-u16-vasnprintf2.c index 9fe2ae88c4..7e3e99f1d8 100644 --- a/tests/unistdio/test-u16-vasnprintf2.c +++ b/tests/unistdio/test-u16-vasnprintf2.c @@ -102,7 +102,7 @@ my_asnprintf (uint16_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u16-vasnprintf3.c b/tests/unistdio/test-u16-vasnprintf3.c index 385aeef75b..0a8d8711f5 100644 --- a/tests/unistdio/test-u16-vasnprintf3.c +++ b/tests/unistdio/test-u16-vasnprintf3.c @@ -102,7 +102,7 @@ my_asnprintf (uint16_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u16-vasprintf1.c b/tests/unistdio/test-u16-vasprintf1.c index 49383a44df..8a424b5b76 100644 --- a/tests/unistdio/test-u16-vasprintf1.c +++ b/tests/unistdio/test-u16-vasprintf1.c @@ -49,7 +49,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u16-vsnprintf1.c b/tests/unistdio/test-u16-vsnprintf1.c index a7a4f49467..db5cfb78b3 100644 --- a/tests/unistdio/test-u16-vsnprintf1.c +++ b/tests/unistdio/test-u16-vsnprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsnprintf () +test_vsnprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u16-vsprintf1.c b/tests/unistdio/test-u16-vsprintf1.c index 235fb0bd66..b9afd91bec 100644 --- a/tests/unistdio/test-u16-vsprintf1.c +++ b/tests/unistdio/test-u16-vsprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsprintf () +test_vsprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u32-asnprintf1.c b/tests/unistdio/test-u32-asnprintf1.c index 51e5168a2d..6e98c81312 100644 --- a/tests/unistdio/test-u32-asnprintf1.c +++ b/tests/unistdio/test-u32-asnprintf1.c @@ -33,7 +33,7 @@ #include "test-u32-asnprintf1.h" static void -test_asnprintf () +test_asnprintf (void) { test_function (u32_asnprintf); } diff --git a/tests/unistdio/test-u32-vasnprintf1.c b/tests/unistdio/test-u32-vasnprintf1.c index 2c7bdea676..c5e921ef4f 100644 --- a/tests/unistdio/test-u32-vasnprintf1.c +++ b/tests/unistdio/test-u32-vasnprintf1.c @@ -61,7 +61,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); test_xfunction (my_xasprintf); diff --git a/tests/unistdio/test-u32-vasnprintf2.c b/tests/unistdio/test-u32-vasnprintf2.c index 40015905d5..e8786de0d0 100644 --- a/tests/unistdio/test-u32-vasnprintf2.c +++ b/tests/unistdio/test-u32-vasnprintf2.c @@ -102,7 +102,7 @@ my_asnprintf (uint32_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u32-vasnprintf3.c b/tests/unistdio/test-u32-vasnprintf3.c index 00a2d4287f..d6d4615840 100644 --- a/tests/unistdio/test-u32-vasnprintf3.c +++ b/tests/unistdio/test-u32-vasnprintf3.c @@ -102,7 +102,7 @@ my_asnprintf (uint32_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u32-vasprintf1.c b/tests/unistdio/test-u32-vasprintf1.c index a4cd5778b4..bec93f5988 100644 --- a/tests/unistdio/test-u32-vasprintf1.c +++ b/tests/unistdio/test-u32-vasprintf1.c @@ -49,7 +49,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u32-vsnprintf1.c b/tests/unistdio/test-u32-vsnprintf1.c index a9b9ac589d..da826fa409 100644 --- a/tests/unistdio/test-u32-vsnprintf1.c +++ b/tests/unistdio/test-u32-vsnprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsnprintf () +test_vsnprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u32-vsprintf1.c b/tests/unistdio/test-u32-vsprintf1.c index d199396e53..ad6b758a5e 100644 --- a/tests/unistdio/test-u32-vsprintf1.c +++ b/tests/unistdio/test-u32-vsprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsprintf () +test_vsprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u8-asnprintf1.c b/tests/unistdio/test-u8-asnprintf1.c index d40151ed8a..0eaf32f67e 100644 --- a/tests/unistdio/test-u8-asnprintf1.c +++ b/tests/unistdio/test-u8-asnprintf1.c @@ -33,7 +33,7 @@ #include "test-u8-asnprintf1.h" static void -test_asnprintf () +test_asnprintf (void) { test_function (u8_asnprintf); } diff --git a/tests/unistdio/test-u8-vasnprintf1.c b/tests/unistdio/test-u8-vasnprintf1.c index ec5a4588ce..54af89ad5c 100644 --- a/tests/unistdio/test-u8-vasnprintf1.c +++ b/tests/unistdio/test-u8-vasnprintf1.c @@ -61,7 +61,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); test_xfunction (my_xasprintf); diff --git a/tests/unistdio/test-u8-vasnprintf2.c b/tests/unistdio/test-u8-vasnprintf2.c index dbb5c9e88e..280a02e52d 100644 --- a/tests/unistdio/test-u8-vasnprintf2.c +++ b/tests/unistdio/test-u8-vasnprintf2.c @@ -92,7 +92,7 @@ my_asnprintf (uint8_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u8-vasnprintf3.c b/tests/unistdio/test-u8-vasnprintf3.c index 33e68e6dbe..9bbc9549c5 100644 --- a/tests/unistdio/test-u8-vasnprintf3.c +++ b/tests/unistdio/test-u8-vasnprintf3.c @@ -92,7 +92,7 @@ my_asnprintf (uint8_t *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-u8-vasprintf1.c b/tests/unistdio/test-u8-vasprintf1.c index 4be3a4395d..a9fc3251c8 100644 --- a/tests/unistdio/test-u8-vasprintf1.c +++ b/tests/unistdio/test-u8-vasprintf1.c @@ -49,7 +49,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u8-vsnprintf1.c b/tests/unistdio/test-u8-vsnprintf1.c index 8056ac730c..4caef2b05a 100644 --- a/tests/unistdio/test-u8-vsnprintf1.c +++ b/tests/unistdio/test-u8-vsnprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsnprintf () +test_vsnprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-u8-vsprintf1.c b/tests/unistdio/test-u8-vsprintf1.c index 08eced9406..6d8f993dbc 100644 --- a/tests/unistdio/test-u8-vsprintf1.c +++ b/tests/unistdio/test-u8-vsprintf1.c @@ -54,7 +54,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsprintf () +test_vsprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-ulc-asnprintf1.c b/tests/unistdio/test-ulc-asnprintf1.c index 22cb2aeb18..300975f7e3 100644 --- a/tests/unistdio/test-ulc-asnprintf1.c +++ b/tests/unistdio/test-ulc-asnprintf1.c @@ -31,7 +31,7 @@ #include "test-ulc-asnprintf1.h" static void -test_asnprintf () +test_asnprintf (void) { test_function (ulc_asnprintf); } diff --git a/tests/unistdio/test-ulc-vasnprintf1.c b/tests/unistdio/test-ulc-vasnprintf1.c index 09df288168..0e2410f1af 100644 --- a/tests/unistdio/test-ulc-vasnprintf1.c +++ b/tests/unistdio/test-ulc-vasnprintf1.c @@ -59,7 +59,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); test_xfunction (my_xasprintf); diff --git a/tests/unistdio/test-ulc-vasnprintf2.c b/tests/unistdio/test-ulc-vasnprintf2.c index 7731a75863..dccd6791b4 100644 --- a/tests/unistdio/test-ulc-vasnprintf2.c +++ b/tests/unistdio/test-ulc-vasnprintf2.c @@ -229,7 +229,7 @@ my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-ulc-vasnprintf3.c b/tests/unistdio/test-ulc-vasnprintf3.c index db01e83904..c93a295237 100644 --- a/tests/unistdio/test-ulc-vasnprintf3.c +++ b/tests/unistdio/test-ulc-vasnprintf3.c @@ -217,7 +217,7 @@ my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) } static void -test_vasnprintf () +test_vasnprintf (void) { test_function (my_asnprintf); } diff --git a/tests/unistdio/test-ulc-vasprintf1.c b/tests/unistdio/test-ulc-vasprintf1.c index 76f762bcd8..8d6a090ed1 100644 --- a/tests/unistdio/test-ulc-vasprintf1.c +++ b/tests/unistdio/test-ulc-vasprintf1.c @@ -47,7 +47,7 @@ my_xasprintf (const char *format, ...) } static void -test_vasprintf () +test_vasprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-ulc-vsnprintf1.c b/tests/unistdio/test-ulc-vsnprintf1.c index b68ae29233..f3e3fef20b 100644 --- a/tests/unistdio/test-ulc-vsnprintf1.c +++ b/tests/unistdio/test-ulc-vsnprintf1.c @@ -47,7 +47,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsnprintf () +test_vsnprintf (void) { test_xfunction (my_xasprintf); } diff --git a/tests/unistdio/test-ulc-vsprintf1.c b/tests/unistdio/test-ulc-vsprintf1.c index b5ae743d10..1a5735bc2a 100644 --- a/tests/unistdio/test-ulc-vsprintf1.c +++ b/tests/unistdio/test-ulc-vsprintf1.c @@ -47,7 +47,7 @@ my_xasprintf (const char *format, ...) } static void -test_vsprintf () +test_vsprintf (void) { test_xfunction (my_xasprintf); }