[PATCH 04/13] manual: Fix missing declaration in twalk example.
Collin Funk
collin.funk1@gmail.com
Sun Sep 28 22:45:57 GMT 2025
Without _GNU_SOURCE defined this file fails to compile with the
following error:
$ gcc manual/examples/twalk.c
manual/examples/twalk.c: In function ‘twalk’:
manual/examples/twalk.c:55:3: error: implicit declaration of function ‘twalk_r’; did you mean ‘twalk’? [-Wimplicit-function-declaration]
55 | twalk_r (root, twalk_with_twalk_r_action, &closure);
| ^~~~~~~
| twalk
---
manual/examples/twalk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/manual/examples/twalk.c b/manual/examples/twalk.c
index e9aa13dc75..970096d036 100644
--- a/manual/examples/twalk.c
+++ b/manual/examples/twalk.c
@@ -15,6 +15,7 @@
along with this program; if not, see <https://www.gnu.org/licenses/>.
*/
+#define _GNU_SOURCE 1
#include <search.h>
struct twalk_with_twalk_r_closure
--
2.51.0
More information about the Libc-alpha
mailing list