From 8a80c7f9d7424a6c70c728dd588c9a47171e88fd Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Sun, 28 Sep 2025 15:17:17 -0700 Subject: [PATCH] manual: Fix missing declaration in strdupa example. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without _GNU_SOURCE defined this file fails to compile with the following error: $ gcc manual/examples/strdupa.c manual/examples/strdupa.c: In function ‘main’: manual/examples/strdupa.c:27:19: error: implicit declaration of function ‘strdupa’; did you mean ‘strdup’? [-Wimplicit-function-declaration] 27 | char *wr_path = strdupa (path); | ^~~~~~~ | strdup manual/examples/strdupa.c:27:19: error: initialization of ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] Reviewed-by: Adhemerval Zanella --- manual/examples/strdupa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/manual/examples/strdupa.c b/manual/examples/strdupa.c index 7fd2293d9f..004a3b3d7c 100644 --- a/manual/examples/strdupa.c +++ b/manual/examples/strdupa.c @@ -15,6 +15,7 @@ along with this program; if not, see . */ +#define _GNU_SOURCE 1 #include #include #include