From e8fbe92f3ca5ff83128d28176c2a43b682ab5b69 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 22 Jun 2014 12:40:10 +0400 Subject: [PATCH] Fix 'implicit declaration of vsnprintf' GCC warning (if strict ANSI mode) * cord/tests/cordtest.c (GC_SNPRINTF): Redirect to sprintf also in case of __STRICT_ANSI__ (i.e., if -ansi compiler option specified). * misc.c (GC_VSNPRINTF): Redirect to vsprintf also in case of __STRICT_ANSI__. --- cord/tests/cordtest.c | 2 +- misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c index e91b6369..adff26b3 100644 --- a/cord/tests/cordtest.c +++ b/cord/tests/cordtest.c @@ -206,7 +206,7 @@ void test_extras(void) } } -#ifdef __DJGPP__ +#if defined(__DJGPP__) || defined(__STRICT_ANSI__) /* snprintf is missing in DJGPP (v2.0.3) */ # define GC_SNPRINTF sprintf # define GC_SNPRINTF_BUFSZ_ARG(bufsz) /* empty */ diff --git a/misc.c b/misc.c index fefbd13e..84cad42b 100644 --- a/misc.c +++ b/misc.c @@ -1497,7 +1497,7 @@ GC_API void GC_CALL GC_enable_incremental(void) #define BUFSZ 1024 -#ifdef DJGPP +#if defined(DJGPP) || defined(__STRICT_ANSI__) /* vsnprintf is missing in DJGPP (v2.0.3) */ # define GC_VSNPRINTF(buf, bufsz, format, args) vsprintf(buf, format, args) #elif defined(_MSC_VER) -- 2.40.0