summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-09-01 16:19:50 -0500
committerPaul Eggert <eggert@cs.ucla.edu>2022-09-02 12:09:32 -0500
commit8b5e2016c7ed2d67f31b03a3d2e361858ff5299b (patch)
treefa240e0ed35eafdf046380604dbfd6ea07cd5ac4 /lib
parent0a647a93cb3d966671bb45effbce21fdf2a36789 (diff)
downloadautoconf-8b5e2016c7ed2d67f31b03a3d2e361858ff5299b.tar.gz
Port to compilers that moan about K&R func decls
* lib/autoconf/c.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY): Use '(void)' rather than '()' in function prototypes, as the latter provokes fatal errors in some compilers nowadays. * lib/autoconf/functions.m4 (AC_FUNC_STRTOD): * tests/fortran.at (AC_F77_DUMMY_MAIN usage): * tests/semantics.at (AC_CHECK_DECLS): Don’t use () in a function decl.
Diffstat (limited to 'lib')
-rw-r--r--lib/autoconf/c.m46
-rw-r--r--lib/autoconf/functions.m43
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index abbb83fe..4751c7f5 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -133,7 +133,7 @@ m4_if([$2], [main], ,
#ifdef __cplusplus
extern "C"
#endif
-char $2 ();])], [return $2 ();])])
+char $2 (void);])], [return $2 ();])])
# AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
@@ -157,7 +157,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)],
#define $1 innocuous_$1
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $1 (); below. */
+ which can conflict with char $1 (void); below. */
#include <limits.h>
#undef $1
@@ -168,7 +168,7 @@ m4_define([AC_LANG_FUNC_LINK_TRY(C)],
#ifdef __cplusplus
extern "C"
#endif
-char $1 ();
+char $1 (void);
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 9f44a1ce..ee519a38 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -1613,9 +1613,6 @@ AC_DEFUN([AC_FUNC_STRTOD],
AC_CACHE_CHECK(for working strtod, ac_cv_func_strtod,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
]AC_INCLUDES_DEFAULT[
-#ifndef strtod
-double strtod ();
-#endif
int
main (void)
{