73 lines
1.9 KiB
Diff
73 lines
1.9 KiB
Diff
From 561f41718335ddd319f551e17a13287a11f15d51 Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Wakely <jwakely@fedoraproject.org>
|
|
Date: Fri, 10 Feb 2023 15:24:13 +0000
|
|
Subject: [PATCH] Patch autoconf fragments for C99 compatibility
|
|
|
|
Do not rely on obsolete C features (implicit int and implicit function
|
|
declarations).
|
|
|
|
https://fedoraproject.org/wiki/Toolchain/PortingToModernC
|
|
---
|
|
autoconf/utils.m4 | 5 +++--
|
|
configure.in | 3 +++
|
|
2 files changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/autoconf/utils.m4 b/autoconf/utils.m4
|
|
index d2f8db1..11f207d 100644
|
|
--- a/autoconf/utils.m4
|
|
+++ b/autoconf/utils.m4
|
|
@@ -62,11 +62,12 @@ yes) i_dlfcn=define;;
|
|
*) i_dlfcn=undef;;
|
|
esac
|
|
cat > dyna.c <<EOM
|
|
-fred () { }
|
|
+int fred () { }
|
|
EOM
|
|
|
|
cat > fred.c <<EOM
|
|
#include <stdio.h>
|
|
+#include <stdlib.h>
|
|
#$i_dlfcn I_DLFCN
|
|
#ifdef I_DLFCN
|
|
#include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
|
|
@@ -78,7 +79,7 @@ cat > fred.c <<EOM
|
|
|
|
extern int fred() ;
|
|
|
|
-main()
|
|
+int main()
|
|
{
|
|
void * handle ;
|
|
void * symbol ;
|
|
diff --git a/configure.in b/configure.in
|
|
index b79957f..4ca6ab8 100644
|
|
--- a/configure.in
|
|
+++ b/configure.in
|
|
@@ -709,6 +709,7 @@ dnl ***
|
|
AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <stdarg.h>
|
|
+ #include <stdlib.h>
|
|
void f (int i, ...) {
|
|
va_list args1, args2;
|
|
va_start (args1, i);
|
|
@@ -728,6 +729,7 @@ AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
|
|
AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <stdarg.h>
|
|
+ #include <stdlib.h>
|
|
void f (int i, ...) {
|
|
va_list args1, args2;
|
|
va_start (args1, i);
|
|
@@ -758,6 +760,7 @@ fi
|
|
AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
|
#include <stdarg.h>
|
|
+ #include <stdlib.h>
|
|
void f (int i, ...) {
|
|
va_list args1, args2;
|
|
va_start (args1, i);
|
|
--
|
|
2.45.2
|
|
|