From dcf360d688551738bd53fb696e828695c238f03c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 18 Jan 2023 10:54:55 +0100 Subject: [PATCH] Avoid implicit declaration memset in have_fpos_pos.c probe Otherwise, the probe result changes with compilers which do not support implicit function declarations, a language feature that was removed from C in 1999. --- Makefile | 2 +- Makefile.simple | 2 +- have_fpos_pos.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6068d9d..22c2e4a 100644 --- a/Makefile +++ b/Makefile @@ -3226,7 +3226,7 @@ have_fgetsetpos.h: have_fgetsetpos.c banned.h have_ban_pragma.h ${MAKE_FILE} ${L ${TRUE}; \ fi -have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h \ +have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h have_string.h \ banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF} ${Q} ${RM} -f fpos_tmp $@ ${H} echo 'forming $@' diff --git a/Makefile.simple b/Makefile.simple index bac6d5d..578832a 100644 --- a/Makefile.simple +++ b/Makefile.simple @@ -2540,7 +2540,7 @@ have_fgetsetpos.h: have_fgetsetpos.c banned.h have_ban_pragma.h ${MAKE_FILE} ${L ${TRUE}; \ fi -have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h \ +have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h have_string.h \ banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF} ${Q} ${RM} -f fpos_tmp $@ ${H} echo 'forming $@' diff --git a/have_fpos_pos.c b/have_fpos_pos.c index 72e2fa4..0527905 100644 --- a/have_fpos_pos.c +++ b/have_fpos_pos.c @@ -28,6 +28,10 @@ #include #include "have_fgetsetpos.h" #include "have_posscl.h" +#include "have_string.h" +#ifdef HAVE_STRING_H +# include +#endif #include "banned.h" /* include after system header <> includes */