logo

utils-std

Collection of commonly available Unix tools
commit: 8dc4a888009e259ab650eb282248bfe81e2dc715
parent f998e53207bd10ddf7ab4c24e654608a203bb884
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 30 Apr 2024 13:41:11 +0200

Fix glibc non-sense for reallocarray

Diffstat:

Mcmd/tr.c2+-
Mconfigure.d/reallocarray.c4++--
Mlib/tr_str.c3++-
3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/cmd/tr.c b/cmd/tr.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. */ -#define _BSD_SOURCE +#define _DEFAULT_SOURCE #include "../lib/tr_str.h" diff --git a/configure.d/reallocarray.c b/configure.d/reallocarray.c @@ -4,7 +4,7 @@ // Because that's what our utilities will use :) #define _POSIX_C_SOURCE 200809L -#define _BSD_SOURCE // for reallocarray +#define _DEFAULT_SOURCE // for reallocarray #include <stdlib.h> // reallocarray @@ -12,5 +12,5 @@ void test() { char *arr = NULL; - reallocarray(&arr, 69, sizeof(*arr)); + (void)reallocarray(&arr, 69, sizeof(*arr)); } diff --git a/lib/tr_str.c b/lib/tr_str.c @@ -31,8 +31,9 @@ * SUCH DAMAGE. */ +#define _DEFAULT_SOURCE + #include "./tr_str.h" -#define _BSD_SOURCE #include <assert.h> #include <ctype.h>