[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c-stack.c and DEBUG: missing import
From: |
Bruno Haible |
Subject: |
Re: c-stack.c and DEBUG: missing import |
Date: |
Sat, 09 May 2020 13:34:25 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
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 <address@hidden>
c-stack: Fix warning when DEBUG is enabled.
Patch suggested by Marc Nieper-Wißkirchen <address@hidden> 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