]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: Fix missing declaration in twalk example.
authorCollin Funk <collin.funk1@gmail.com>
Sun, 28 Sep 2025 22:05:40 +0000 (15:05 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 30 Sep 2025 00:01:54 +0000 (17:01 -0700)
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

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
manual/examples/twalk.c

index e9aa13dc759bb8c57d978442f4df8ced6a7d0f42..970096d03650dda2ac1f4e5dd9450ec07a281a93 100644 (file)
@@ -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