Hi Marc,

> Please add
> 
> #ifdef DEBUG
> # include <stdio.h>
> #endif
> 
> at the beginning of c-stack.c.
> 
> When the DEBUG flag is enabled, c-stack.c uses sprintf and without the
> suggested addition gcc complains about an implicit declaration of the
> function sprintf.

Yup. Thanks for the suggestion. Done.


2020-05-09  Bruno Haible  <br...@clisp.org>

        c-stack: Fix warning when DEBUG is enabled.
        Patch suggested by Marc Nieper-Wißkirchen <marc.nieper+...@gmail.com> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00081.html>.
        * lib/c-stack.c: Include <stdio.h>.

diff --git a/lib/c-stack.c b/lib/c-stack.c
index 4050d08..e486591 100644
--- a/lib/c-stack.c
+++ b/lib/c-stack.c
@@ -65,6 +65,10 @@ typedef struct sigaltstack stack_t;
 
 #include <unistd.h>
 
+#if DEBUG
+# include <stdio.h>
+#endif
+
 #if HAVE_LIBSIGSEGV
 # include <sigsegv.h>
 #endif


Reply via email to