grep/grep-configure-c99.patch

47 lines
1.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Work around a recent regression in C99 compatibility in autoconf.
The configure script was generated with an autoconf prerelease,
and the issue has been fixed upstream with this commit:
commit bf5a75953b6d504f0405b1ca33b039b8dd39eef4
Author: Zack Weinberg <zackw@panix.com>
Date: Thu Nov 10 12:05:30 2022 -0500
More fixes for compilers that reject K&R function definitions.
This fixes all of the remaining failures exposed by running the
testsuite with GCC 12 and
CC='cc -Wimplicit-function-declaration -Wold-style-definition
-Wimplicit-int -Werror'
.
* lib/autoconf/c.m4 (_AC_C_C89_TEST_GLOBALS): Dont use K&R function
definitions.
* lib/autoconf/specific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Likewise.
(AC_FUNC_MKTIME): Declare functions taking no arguments as fn (void)
not fn ().
* lib/autoconf/c.m4 (_AC_C_C99_TEST_GLOBALS): Declare free().
diff --git a/configure b/configure
index 51bd10995a6f57e8..4bdd3ecca7d2c793 100755
--- a/configure
+++ b/configure
@@ -3954,9 +3954,7 @@ struct stat;
/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
struct buf { int x; };
struct buf * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
+static char *e (char **p, int i)
{
return p[i];
}
@@ -4007,6 +4005,7 @@ extern int puts (const char *);
extern int printf (const char *, ...);
extern int dprintf (int, const char *, ...);
extern void *malloc (size_t);
+extern void free (void *);
// Check varargs macros. These examples are taken from C99 6.10.3.5.
// dprintf is used instead of fprintf to avoid needing to declare