Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 22 Apr 2023 22:06:13 +0200
From: Jens Gustedt <>
Subject: [C23 divers headers 05/17] C23: memccpy, strdup and strndup are now
 standard C

Just remove the feature guards around these. These guards had not even
strictly been necessary before, because prefixes mem and str are
 include/string.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/include/string.h b/include/string.h
index db73d2a9..7df7a402 100644
--- a/include/string.h
+++ b/include/string.h
@@ -55,6 +55,10 @@ size_t strlen (const char *);
 char *strerror (int);
+char *strdup (const char *);
+char *strndup (const char *, size_t);
+void *memccpy (void *__restrict, const void *__restrict, int, size_t);
 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
 #include <strings.h>
@@ -67,8 +71,6 @@ int strerror_r (int, char *, size_t);
 char *stpcpy(char *__restrict, const char *__restrict);
 char *stpncpy(char *__restrict, const char *__restrict, size_t);
 size_t strnlen (const char *, size_t);
-char *strdup (const char *);
-char *strndup (const char *, size_t);
 char *strsignal(int);
 char *strerror_l (int, locale_t);
 int strcoll_l (const char *, const char *, locale_t);
@@ -76,11 +78,6 @@ size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
 void *memmem(const void *, size_t, const void *, size_t);
-#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
- || defined(_BSD_SOURCE)
-void *memccpy (void *__restrict, const void *__restrict, int, size_t);
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 char *strsep(char **, const char *);
 size_t strlcat (char *, const char *, size_t);

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.