aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/Makefile9
-rw-r--r--string/_strerror.c2
-rw-r--r--string/argz-addsep.c2
-rw-r--r--string/argz-append.c2
-rw-r--r--string/argz-count.c2
-rw-r--r--string/argz-create.c2
-rw-r--r--string/argz-ctsep.c2
-rw-r--r--string/argz-delete.c4
-rw-r--r--string/argz-extract.c4
-rw-r--r--string/argz-insert.c2
-rw-r--r--string/argz-next.c2
-rw-r--r--string/argz-replace.c10
-rw-r--r--string/argz-stringify.c2
-rw-r--r--string/argz.h4
-rw-r--r--string/basename.c2
-rw-r--r--string/bcopy.c2
-rw-r--r--string/bits/endian.h2
-rw-r--r--string/bits/string_fortified.h2
-rw-r--r--string/bits/strings_fortified.h2
-rw-r--r--string/bug-strcoll2.c2
-rw-r--r--string/byteswap.h2
-rw-r--r--string/bzero.c2
-rw-r--r--string/endian.h2
-rw-r--r--string/envz.c6
-rw-r--r--string/envz.h2
-rw-r--r--string/explicit_bzero.c2
-rw-r--r--string/ffs.c2
-rw-r--r--string/ffsll.c2
-rw-r--r--string/memccpy.c2
-rw-r--r--string/memchr.c2
-rw-r--r--string/memcmp.c2
-rw-r--r--string/memcmpeq.c2
-rw-r--r--string/memcpy.c2
-rw-r--r--string/memfrob.c2
-rw-r--r--string/memmem.c2
-rw-r--r--string/memmove.c2
-rw-r--r--string/memory.h2
-rw-r--r--string/mempcpy.c2
-rw-r--r--string/memrchr.c2
-rw-r--r--string/memset.c2
-rw-r--r--string/rawmemchr.c2
-rw-r--r--string/sigabbrev_np.c2
-rw-r--r--string/sigdescr_np.c2
-rw-r--r--string/stpcpy.c2
-rw-r--r--string/stpncpy.c2
-rw-r--r--string/str-two-way.h2
-rw-r--r--string/stratcliff.c2
-rw-r--r--string/strcasecmp.c2
-rw-r--r--string/strcasecmp_l.c2
-rw-r--r--string/strcasestr.c2
-rw-r--r--string/strcat.c2
-rw-r--r--string/strchr.c2
-rw-r--r--string/strchrnul.c2
-rw-r--r--string/strcmp.c2
-rw-r--r--string/strcoll.c2
-rw-r--r--string/strcoll_l.c2
-rw-r--r--string/strcpy.c2
-rw-r--r--string/strcspn.c2
-rw-r--r--string/strdup.c2
-rw-r--r--string/strerror.c4
-rw-r--r--string/strerror_l.c37
-rw-r--r--string/strerrordesc_np.c2
-rw-r--r--string/strerrorname_np.c2
-rw-r--r--string/strfry.c2
-rw-r--r--string/string-inlines.c2
-rw-r--r--string/string.h2
-rw-r--r--string/strings.h2
-rw-r--r--string/strlcat.c2
-rw-r--r--string/strlcpy.c2
-rw-r--r--string/strlen.c2
-rw-r--r--string/strncase.c2
-rw-r--r--string/strncase_l.c2
-rw-r--r--string/strncat.c2
-rw-r--r--string/strncmp.c2
-rw-r--r--string/strncpy.c2
-rw-r--r--string/strndup.c2
-rw-r--r--string/strnlen.c2
-rw-r--r--string/strpbrk.c2
-rw-r--r--string/strrchr.c2
-rw-r--r--string/strsep.c2
-rw-r--r--string/strsignal.c38
-rw-r--r--string/strspn.c2
-rw-r--r--string/strstr.c2
-rw-r--r--string/strtok.c2
-rw-r--r--string/strtok_r.c2
-rw-r--r--string/strverscmp.c2
-rw-r--r--string/strxfrm.c2
-rw-r--r--string/strxfrm_l.c2
-rw-r--r--string/swab.c2
-rw-r--r--string/test-Xncmp-nonarray.c2
-rw-r--r--string/test-Xnlen-nonarray.c2
-rw-r--r--string/test-bcopy.c2
-rw-r--r--string/test-bzero.c2
-rw-r--r--string/test-endian-file-scope.c2
-rw-r--r--string/test-endian-sign-conversion.c2
-rw-r--r--string/test-endian-types.c2
-rw-r--r--string/test-explicit_bzero.c2
-rw-r--r--string/test-ffs.c2
-rw-r--r--string/test-memccpy.c2
-rw-r--r--string/test-memchr.c2
-rw-r--r--string/test-memcmp.c2
-rw-r--r--string/test-memcmpeq.c2
-rw-r--r--string/test-memcpy-large.c2
-rw-r--r--string/test-memcpy-support.h2
-rw-r--r--string/test-memcpy.c2
-rw-r--r--string/test-memmem.c2
-rw-r--r--string/test-memmove.c4
-rw-r--r--string/test-mempcpy.c2
-rw-r--r--string/test-memrchr.c2
-rw-r--r--string/test-memset.c4
-rw-r--r--string/test-memswap.c2
-rw-r--r--string/test-rawmemchr.c2
-rw-r--r--string/test-sig_np.c2
-rw-r--r--string/test-stpcpy.c2
-rw-r--r--string/test-stpncpy.c2
-rw-r--r--string/test-strcasecmp.c2
-rw-r--r--string/test-strcasestr.c2
-rw-r--r--string/test-strcat.c2
-rw-r--r--string/test-strchr.c67
-rw-r--r--string/test-strchrnul.c2
-rw-r--r--string/test-strcmp.c2
-rw-r--r--string/test-strcpy.c2
-rw-r--r--string/test-strcspn.c2
-rw-r--r--string/test-strdup.c2
-rw-r--r--string/test-strerror-errno.c2
-rw-r--r--string/test-string.h13
-rw-r--r--string/test-strlen.c2
-rw-r--r--string/test-strncasecmp.c2
-rw-r--r--string/test-strncat.c2
-rw-r--r--string/test-strncmp.c2
-rw-r--r--string/test-strncpy.c2
-rw-r--r--string/test-strndup.c2
-rw-r--r--string/test-strnlen.c2
-rw-r--r--string/test-strpbrk.c2
-rw-r--r--string/test-strrchr.c2
-rw-r--r--string/test-strspn.c2
-rw-r--r--string/test-strstr.c2
-rw-r--r--string/testcopy.c2
-rw-r--r--string/tester.c13
-rw-r--r--string/tst-bswap.c2
-rw-r--r--string/tst-cmp.c2
-rw-r--r--string/tst-inlcall.c2
-rw-r--r--string/tst-memmove-overflow.c2
-rw-r--r--string/tst-strcoll-overflow.c2
-rw-r--r--string/tst-strerror-fail.c2
-rw-r--r--string/tst-strerror.c2
-rw-r--r--string/tst-strlcat.c2
-rw-r--r--string/tst-strlcat2.c2
-rw-r--r--string/tst-strlcpy.c2
-rw-r--r--string/tst-strlcpy2.c2
-rw-r--r--string/tst-strsignal.c2
-rw-r--r--string/tst-strtok_r.c2
-rw-r--r--string/tst-xbzero-opt.c4
-rw-r--r--string/wordcopy.c2
-rw-r--r--string/xpg-strerror.c2
155 files changed, 295 insertions, 206 deletions
diff --git a/string/Makefile b/string/Makefile
index 1dff405..c83b195 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2024 Free Software Foundation, Inc.
+# Copyright (C) 1991-2025 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -252,8 +252,11 @@ endif
include ../Rules
-CFLAGS-inl-tester.c += -fno-builtin
-CFLAGS-noinl-tester.c += -fno-builtin
+CFLAGS-tester.c += $(test-config-cflags-wno-fortify-source)
+CFLAGS-inl-tester.c += -fno-builtin \
+ $(test-config-cflags-wno-fortify-source)
+CFLAGS-noinl-tester.c += -fno-builtin \
+ $(test-config-cflags-wno-fortify-source)
CFLAGS-tst-strlen.c += -fno-builtin
CFLAGS-stratcliff.c += -fno-builtin
CFLAGS-test-ffs.c += -fno-builtin
diff --git a/string/_strerror.c b/string/_strerror.c
index 772fbf0..71c98a6 100644
--- a/string/_strerror.c
+++ b/string/_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-addsep.c b/string/argz-addsep.c
index 776258d..465e8c3 100644
--- a/string/argz-addsep.c
+++ b/string/argz-addsep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-append.c b/string/argz-append.c
index e3b12c3..c4fd02e 100644
--- a/string/argz-append.c
+++ b/string/argz-append.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-count.c b/string/argz-count.c
index 4b3dca8..db2ea42 100644
--- a/string/argz-count.c
+++ b/string/argz-count.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-create.c b/string/argz-create.c
index 39375e4..e3b0b51 100644
--- a/string/argz-create.c
+++ b/string/argz-create.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-ctsep.c b/string/argz-ctsep.c
index accd1e6..dec2ca7 100644
--- a/string/argz-ctsep.c
+++ b/string/argz-ctsep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-delete.c b/string/argz-delete.c
index e513e46..9e3425c 100644
--- a/string/argz-delete.c
+++ b/string/argz-delete.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ argz_delete (char **argz, size_t *argz_len, char *entry)
if (*argz_len == 0)
{
free (*argz);
- *argz = 0;
+ *argz = NULL;
}
}
}
diff --git a/string/argz-extract.c b/string/argz-extract.c
index e685da5..d73394a 100644
--- a/string/argz-extract.c
+++ b/string/argz-extract.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,6 +30,6 @@ __argz_extract (const char *argz, size_t len, char **argv)
argz += part_len + 1;
len -= part_len + 1;
}
- *argv = 0;
+ *argv = NULL;
}
weak_alias (__argz_extract, argz_extract)
diff --git a/string/argz-insert.c b/string/argz-insert.c
index 222c5d3..660b4dc 100644
--- a/string/argz-insert.c
+++ b/string/argz-insert.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-next.c b/string/argz-next.c
index d37a4e9..aac67a9 100644
--- a/string/argz-next.c
+++ b/string/argz-next.c
@@ -1,5 +1,5 @@
/* Iterate through the elements of an argz block.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz-replace.c b/string/argz-replace.c
index fdd9a8e..c29d547 100644
--- a/string/argz-replace.c
+++ b/string/argz-replace.c
@@ -1,5 +1,5 @@
/* String replacement in an argz vector
- Copyright (C) 1997-2024 Free Software Foundation, Inc.
+ Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@ str_append (char **to, size_t *to_len, const char *buf, const size_t buf_len)
else
{
free (*to);
- *to = 0;
+ *to = NULL;
}
}
@@ -53,10 +53,10 @@ __argz_replace (char **argz, size_t *argz_len, const char *str, const char *with
if (str && *str)
{
- char *arg = 0;
+ char *arg = NULL;
char *src = *argz;
size_t src_len = *argz_len;
- char *dst = 0;
+ char *dst = NULL;
size_t dst_len = 0;
int delayed_copy = 1; /* True while we've avoided copying anything. */
size_t str_len = strlen (str), with_len = strlen (with);
@@ -84,7 +84,7 @@ __argz_replace (char **argz, size_t *argz_len, const char *str, const char *with
else
{
str_append (&to, &to_len, from, strlen (from));
- from = 0;
+ from = NULL;
}
}
}
diff --git a/string/argz-stringify.c b/string/argz-stringify.c
index 9695ff1..b71f511 100644
--- a/string/argz-stringify.c
+++ b/string/argz-stringify.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/argz.h b/string/argz.h
index 49e85a0..57300ec 100644
--- a/string/argz.h
+++ b/string/argz.h
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated arg vectors.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -141,7 +141,7 @@ __NTH (__argz_next (const char *__argz, size_t __argz_len,
return __entry >= __argz + __argz_len ? (char *) NULL : (char *) __entry;
}
else
- return __argz_len > 0 ? (char *) __argz : 0;
+ return __argz_len > 0 ? (char *) __argz : NULL;
}
__extern_inline char *
__NTH (argz_next (const char *__argz, size_t __argz_len,
diff --git a/string/basename.c b/string/basename.c
index 03498d7..dd2c818 100644
--- a/string/basename.c
+++ b/string/basename.c
@@ -1,5 +1,5 @@
/* Return the name-within-directory of a file name.
- Copyright (C) 1996-2024 Free Software Foundation, Inc.
+ Copyright (C) 1996-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bcopy.c b/string/bcopy.c
index f9809d1..83bac65 100644
--- a/string/bcopy.c
+++ b/string/bcopy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bits/endian.h b/string/bits/endian.h
index 08ca11e..e267b2b 100644
--- a/string/bits/endian.h
+++ b/string/bits/endian.h
@@ -1,5 +1,5 @@
/* Endian macros for string.h functions
- Copyright (C) 1992-2024 Free Software Foundation, Inc.
+ Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bits/string_fortified.h b/string/bits/string_fortified.h
index 5c93dd6..ae14cfb 100644
--- a/string/bits/string_fortified.h
+++ b/string/bits/string_fortified.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bits/strings_fortified.h b/string/bits/strings_fortified.h
index 49144c4..be65d59 100644
--- a/string/bits/strings_fortified.h
+++ b/string/bits/strings_fortified.h
@@ -1,5 +1,5 @@
/* Fortify macros for strings.h functions.
- Copyright (C) 2017-2024 Free Software Foundation, Inc.
+ Copyright (C) 2017-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bug-strcoll2.c b/string/bug-strcoll2.c
index fb34673..75eaae9 100644
--- a/string/bug-strcoll2.c
+++ b/string/bug-strcoll2.c
@@ -1,5 +1,5 @@
/* Bug 18589: sort-test.sh fails at random.
- Copyright (C) 2015-2024 Free Software Foundation, Inc.
+ Copyright (C) 2015-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/byteswap.h b/string/byteswap.h
index 66efb8f..e073177 100644
--- a/string/byteswap.h
+++ b/string/byteswap.h
@@ -1,5 +1,5 @@
/* Swap byte order for 16, 32 and 64 bit values
- Copyright (C) 1997-2024 Free Software Foundation, Inc.
+ Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/bzero.c b/string/bzero.c
index ba351d8..334b417 100644
--- a/string/bzero.c
+++ b/string/bzero.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/endian.h b/string/endian.h
index fd20a2b..6b5d65f 100644
--- a/string/endian.h
+++ b/string/endian.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/envz.c b/string/envz.c
index cb02b4b..e7d2443 100644
--- a/string/envz.c
+++ b/string/envz.c
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated environment vectors
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,7 +50,7 @@ envz_entry (const char *envz, size_t envz_len, const char *name)
envz++, envz_len--; /* skip '\0' */
}
- return 0;
+ return NULL;
}
libc_hidden_def (envz_entry)
@@ -67,7 +67,7 @@ envz_get (const char *envz, size_t envz_len, const char *name)
if (*entry)
entry++;
else
- entry = 0; /* A null entry. */
+ entry = NULL; /* A null entry. */
}
return entry;
}
diff --git a/string/envz.h b/string/envz.h
index 8a4b0a7..ec6cabe 100644
--- a/string/envz.h
+++ b/string/envz.h
@@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated environment vectors
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/explicit_bzero.c b/string/explicit_bzero.c
index c730f53..bde008b 100644
--- a/string/explicit_bzero.c
+++ b/string/explicit_bzero.c
@@ -1,5 +1,5 @@
/* Erasure of sensitive data, generic implementation.
- Copyright (C) 2016-2024 Free Software Foundation, Inc.
+ Copyright (C) 2016-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/ffs.c b/string/ffs.c
index 760c2bd..a2aa5b1 100644
--- a/string/ffs.c
+++ b/string/ffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/ffsll.c b/string/ffsll.c
index 0ec39a0..1b01d8f 100644
--- a/string/ffsll.c
+++ b/string/ffsll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memccpy.c b/string/memccpy.c
index 6d36d92..c2a742b 100644
--- a/string/memccpy.c
+++ b/string/memccpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memchr.c b/string/memchr.c
index 08b5c41..9dbefa2 100644
--- a/string/memchr.c
+++ b/string/memchr.c
@@ -1,5 +1,5 @@
/* Scan memory for a character. Generic version
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memcmp.c b/string/memcmp.c
index 05d1709..cd595ce9 100644
--- a/string/memcmp.c
+++ b/string/memcmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/string/memcmpeq.c b/string/memcmpeq.c
index 41f4a0e..12f4d73 100644
--- a/string/memcmpeq.c
+++ b/string/memcmpeq.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memcpy.c b/string/memcpy.c
index f221d4e..5ec28ce 100644
--- a/string/memcpy.c
+++ b/string/memcpy.c
@@ -1,6 +1,6 @@
/* Copy memory to memory until the specified number of bytes
has been copied. Overlap is NOT handled correctly.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memfrob.c b/string/memfrob.c
index 08ca360..45d28a8 100644
--- a/string/memfrob.c
+++ b/string/memfrob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memmem.c b/string/memmem.c
index a4117f8..8d9b7d1 100644
--- a/string/memmem.c
+++ b/string/memmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memmove.c b/string/memmove.c
index 3fad5f1..1572481 100644
--- a/string/memmove.c
+++ b/string/memmove.c
@@ -1,6 +1,6 @@
/* Copy memory to memory until the specified number of bytes
has been copied. Overlap is handled correctly.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memory.h b/string/memory.h
index 774aec6..884577a 100644
--- a/string/memory.h
+++ b/string/memory.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/mempcpy.c b/string/mempcpy.c
index 925ff54..efbc9d4 100644
--- a/string/mempcpy.c
+++ b/string/mempcpy.c
@@ -1,7 +1,7 @@
/* Copy memory to memory until the specified number of bytes
has been copied, return pointer to following byte.
Overlap is NOT handled correctly.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Torbjorn Granlund (tege@sics.se).
diff --git a/string/memrchr.c b/string/memrchr.c
index 6511dac..084743c 100644
--- a/string/memrchr.c
+++ b/string/memrchr.c
@@ -1,5 +1,5 @@
/* memrchr -- find the last occurrence of a byte in a memory block
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/memset.c b/string/memset.c
index 64e382a..1dd8363 100644
--- a/string/memset.c
+++ b/string/memset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/rawmemchr.c b/string/rawmemchr.c
index bf2cad1..bbd2d26 100644
--- a/string/rawmemchr.c
+++ b/string/rawmemchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/sigabbrev_np.c b/string/sigabbrev_np.c
index 750fbdd..6622988 100644
--- a/string/sigabbrev_np.c
+++ b/string/sigabbrev_np.c
@@ -1,5 +1,5 @@
/* Return string describing signal abbreviation.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/sigdescr_np.c b/string/sigdescr_np.c
index e51632c..990ddd6 100644
--- a/string/sigdescr_np.c
+++ b/string/sigdescr_np.c
@@ -1,5 +1,5 @@
/* Return string describing signal.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/stpcpy.c b/string/stpcpy.c
index 5b17c67..2148022 100644
--- a/string/stpcpy.c
+++ b/string/stpcpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/stpncpy.c b/string/stpncpy.c
index 51e989d..36b65e9 100644
--- a/string/stpncpy.c
+++ b/string/stpncpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/str-two-way.h b/string/str-two-way.h
index 0e663b9..b28fdc3 100644
--- a/string/str-two-way.h
+++ b/string/str-two-way.h
@@ -1,5 +1,5 @@
/* Byte-wise substring search, using the Two-Way algorithm.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Eric Blake <ebb9@byu.net>, 2008.
diff --git a/string/stratcliff.c b/string/stratcliff.c
index ab213b8..48afa68 100644
--- a/string/stratcliff.c
+++ b/string/stratcliff.c
@@ -1,5 +1,5 @@
/* Test for string function add boundaries of usable memory.
- Copyright (C) 1996-2024 Free Software Foundation, Inc.
+ Copyright (C) 1996-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcasecmp.c b/string/strcasecmp.c
index ab75f22..6c241d9 100644
--- a/string/strcasecmp.c
+++ b/string/strcasecmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcasecmp_l.c b/string/strcasecmp_l.c
index 6f482bf..ccd3ea7 100644
--- a/string/strcasecmp_l.c
+++ b/string/strcasecmp_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcasestr.c b/string/strcasestr.c
index f03d13d..52ca54a 100644
--- a/string/strcasestr.c
+++ b/string/strcasestr.c
@@ -1,5 +1,5 @@
/* Return the offset of one string within another.
- Copyright (C) 1994-2024 Free Software Foundation, Inc.
+ Copyright (C) 1994-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcat.c b/string/strcat.c
index 891ae22..f7cd74c 100644
--- a/string/strcat.c
+++ b/string/strcat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strchr.c b/string/strchr.c
index 50efaf4..935c0ab 100644
--- a/string/strchr.c
+++ b/string/strchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strchrnul.c b/string/strchrnul.c
index f64d52e..3e09964 100644
--- a/string/strchrnul.c
+++ b/string/strchrnul.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcmp.c b/string/strcmp.c
index 2bca399..f79dd92 100644
--- a/string/strcmp.c
+++ b/string/strcmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcoll.c b/string/strcoll.c
index d95e845..730f6dd 100644
--- a/string/strcoll.c
+++ b/string/strcoll.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcoll_l.c b/string/strcoll_l.c
index 06aa142..72388f0 100644
--- a/string/strcoll_l.c
+++ b/string/strcoll_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcpy.c b/string/strcpy.c
index 640fffd..3f96eb7 100644
--- a/string/strcpy.c
+++ b/string/strcpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strcspn.c b/string/strcspn.c
index 7058533..b48e6b4 100644
--- a/string/strcspn.c
+++ b/string/strcspn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strdup.c b/string/strdup.c
index 794dbf1..a6dd840 100644
--- a/string/strdup.c
+++ b/string/strdup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strerror.c b/string/strerror.c
index 107d9d3..daabec8 100644
--- a/string/strerror.c
+++ b/string/strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,5 +21,5 @@
char *
strerror (int errnum)
{
- return __strerror_l (errnum, __libc_tsd_get (locale_t, LOCALE));
+ return __strerror_l (errnum, __libc_tsd_LOCALE);
}
diff --git a/string/strerror_l.c b/string/strerror_l.c
index 15cce26..90d9c9c 100644
--- a/string/strerror_l.c
+++ b/string/strerror_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
#include <tls-internal.h>
-
+#include <libc-internal.h>
static const char *
translate (const char *str, locale_t loc)
@@ -31,6 +31,12 @@ translate (const char *str, locale_t loc)
return res;
}
+static char *
+unknown_error (locale_t loc)
+{
+ return (char *) translate ("Unknown error", loc);
+}
+
/* Return a string describing the errno code in ERRNUM. */
char *
@@ -40,18 +46,25 @@ __strerror_l (int errnum, locale_t loc)
char *err = (char *) __get_errlist (errnum);
if (__glibc_unlikely (err == NULL))
{
- struct tls_internal_t *tls_internal = __glibc_tls_internal ();
- free (tls_internal->strerror_l_buf);
- if (__asprintf (&tls_internal->strerror_l_buf, "%s%d",
- translate ("Unknown error ", loc), errnum) > 0)
- err = tls_internal->strerror_l_buf;
- else
+ if (__libc_initial)
{
- /* The memory was freed above. */
- tls_internal->strerror_l_buf = NULL;
- /* Provide a fallback translation. */
- err = (char *) translate ("Unknown error", loc);
+ struct tls_internal_t *tls_internal = __glibc_tls_internal ();
+ free (tls_internal->strerror_l_buf);
+ if (__asprintf (&tls_internal->strerror_l_buf, "%s%d",
+ translate ("Unknown error ", loc), errnum) > 0)
+ err = tls_internal->strerror_l_buf;
+ else
+ {
+ /* The memory was freed above. */
+ tls_internal->strerror_l_buf = NULL;
+ /* Provide a fallback translation. */
+ err = unknown_error (loc);
+ }
}
+ else
+ /* Secondary namespaces use a different malloc, so cannot
+ participate in the buffer management. */
+ err = unknown_error (loc);
}
else
err = (char *) translate (err, loc);
diff --git a/string/strerrordesc_np.c b/string/strerrordesc_np.c
index 49b6598..09b975e 100644
--- a/string/strerrordesc_np.c
+++ b/string/strerrordesc_np.c
@@ -1,5 +1,5 @@
/* Return string describing error number.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strerrorname_np.c b/string/strerrorname_np.c
index 042cea3..abfade5 100644
--- a/string/strerrorname_np.c
+++ b/string/strerrorname_np.c
@@ -1,5 +1,5 @@
/* Return string describing errno name.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strfry.c b/string/strfry.c
index 6092d43..b32764e 100644
--- a/string/strfry.c
+++ b/string/strfry.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/string-inlines.c b/string/string-inlines.c
index e069feb..e0472ff 100644
--- a/string/string-inlines.c
+++ b/string/string-inlines.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/string.h b/string/string.h
index d2d5c5f..df4d489 100644
--- a/string/string.h
+++ b/string/string.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strings.h b/string/strings.h
index ebf7412..c5f3aa7 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strlcat.c b/string/strlcat.c
index 40353b9..289cdd1 100644
--- a/string/strlcat.c
+++ b/string/strlcat.c
@@ -1,5 +1,5 @@
/* Append a null-terminated string to another string, with length checking.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strlcpy.c b/string/strlcpy.c
index c6c33b1..d1c5c58 100644
--- a/string/strlcpy.c
+++ b/string/strlcpy.c
@@ -1,5 +1,5 @@
/* Copy a null-terminated string to a fixed-size buffer, with length checking.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strlen.c b/string/strlen.c
index a0378c5..4d95d57 100644
--- a/string/strlen.c
+++ b/string/strlen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strncase.c b/string/strncase.c
index 0210feb..7be4f20 100644
--- a/string/strncase.c
+++ b/string/strncase.c
@@ -1,6 +1,6 @@
/* Compare at most N characters of two strings without taking care for
the case.
- Copyright (C) 1992-2024 Free Software Foundation, Inc.
+ Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strncase_l.c b/string/strncase_l.c
index 4be5852..b351776 100644
--- a/string/strncase_l.c
+++ b/string/strncase_l.c
@@ -1,6 +1,6 @@
/* Compare at most N characters of two strings without taking care for
the case using given locale.
- Copyright (C) 1997-2024 Free Software Foundation, Inc.
+ Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strncat.c b/string/strncat.c
index 4600f01..7658349 100644
--- a/string/strncat.c
+++ b/string/strncat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strncmp.c b/string/strncmp.c
index 67cc975..79a21c1 100644
--- a/string/strncmp.c
+++ b/string/strncmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strncpy.c b/string/strncpy.c
index 178380c..f6e1701 100644
--- a/string/strncpy.c
+++ b/string/strncpy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strndup.c b/string/strndup.c
index 05095d2..ba55f56 100644
--- a/string/strndup.c
+++ b/string/strndup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strnlen.c b/string/strnlen.c
index ad4a2cb..8207225 100644
--- a/string/strnlen.c
+++ b/string/strnlen.c
@@ -1,5 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
diff --git a/string/strpbrk.c b/string/strpbrk.c
index d2156c7..3430cc3 100644
--- a/string/strpbrk.c
+++ b/string/strpbrk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strrchr.c b/string/strrchr.c
index dc02e77..0e09a68 100644
--- a/string/strrchr.c
+++ b/string/strrchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strsep.c b/string/strsep.c
index 7b6a504..21100c9 100644
--- a/string/strsep.c
+++ b/string/strsep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strsignal.c b/string/strsignal.c
index 3114601..6983106 100644
--- a/string/strsignal.c
+++ b/string/strsignal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,6 +21,7 @@
#include <string.h>
#include <libintl.h>
#include <tls-internal.h>
+#include <libc-internal.h>
/* Return a string describing the meaning of the signal number SIGNUM. */
char *
@@ -30,21 +31,28 @@ strsignal (int signum)
if (desc != NULL)
return _(desc);
- struct tls_internal_t *tls_internal = __glibc_tls_internal ();
- free (tls_internal->strsignal_buf);
+ if (__libc_initial)
+ {
+ struct tls_internal_t *tls_internal = __glibc_tls_internal ();
+ free (tls_internal->strsignal_buf);
- int r;
+ int r;
#ifdef SIGRTMIN
- if (signum >= SIGRTMIN && signum <= SIGRTMAX)
- r = __asprintf (&tls_internal->strsignal_buf, _("Real-time signal %d"),
- signum - SIGRTMIN);
- else
+ if (signum >= SIGRTMIN && signum <= SIGRTMAX)
+ r = __asprintf (&tls_internal->strsignal_buf, _("Real-time signal %d"),
+ signum - SIGRTMIN);
+ else
#endif
- r = __asprintf (&tls_internal->strsignal_buf, _("Unknown signal %d"),
- signum);
-
- if (r == -1)
- tls_internal->strsignal_buf = NULL;
-
- return tls_internal->strsignal_buf;
+ r = __asprintf (&tls_internal->strsignal_buf, _("Unknown signal %d"),
+ signum);
+
+ if (r >= 0)
+ return tls_internal->strsignal_buf;
+ else
+ tls_internal->strsignal_buf = NULL;
+ }
+ /* Fall through on asprintf error, and for !__libc_initial:
+ secondary namespaces use a different malloc and cannot
+ participate in the buffer management. */
+ return _("Unknown signal");
}
diff --git a/string/strspn.c b/string/strspn.c
index 74c5333..f1751d6 100644
--- a/string/strspn.c
+++ b/string/strspn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strstr.c b/string/strstr.c
index 7b22bd1..2e3674e 100644
--- a/string/strstr.c
+++ b/string/strstr.c
@@ -1,5 +1,5 @@
/* Return the offset of one string within another.
- Copyright (C) 1994-2024 Free Software Foundation, Inc.
+ Copyright (C) 1994-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strtok.c b/string/strtok.c
index 4b178f7..d0c69af 100644
--- a/string/strtok.c
+++ b/string/strtok.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strtok_r.c b/string/strtok_r.c
index 78b460f..a6b4ed1 100644
--- a/string/strtok_r.c
+++ b/string/strtok_r.c
@@ -1,5 +1,5 @@
/* Reentrant string tokenizer. Generic version.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strverscmp.c b/string/strverscmp.c
index 6164b86..a2e099c 100644
--- a/string/strverscmp.c
+++ b/string/strverscmp.c
@@ -1,5 +1,5 @@
/* Compare strings while treating digits characters numerically.
- Copyright (C) 1997-2024 Free Software Foundation, Inc.
+ Copyright (C) 1997-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
diff --git a/string/strxfrm.c b/string/strxfrm.c
index 2b9c959..a6cd6cd 100644
--- a/string/strxfrm.c
+++ b/string/strxfrm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
index 82b390c..ab16e1f 100644
--- a/string/strxfrm_l.c
+++ b/string/strxfrm_l.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/swab.c b/string/swab.c
index 2c32954..de1b52d 100644
--- a/string/swab.c
+++ b/string/swab.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-Xncmp-nonarray.c b/string/test-Xncmp-nonarray.c
index 9f3a3ca..6d4f5ea 100644
--- a/string/test-Xncmp-nonarray.c
+++ b/string/test-Xncmp-nonarray.c
@@ -1,5 +1,5 @@
/* Test non-array inputs to string comparison functions.
- Copyright (C) 2024 Free Software Foundation, Inc.
+ Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-Xnlen-nonarray.c b/string/test-Xnlen-nonarray.c
index 499bef2..f88eadf 100644
--- a/string/test-Xnlen-nonarray.c
+++ b/string/test-Xnlen-nonarray.c
@@ -1,5 +1,5 @@
/* Test non-array inputs to string length functions.
- Copyright (C) 2024 Free Software Foundation, Inc.
+ Copyright (C) 2024-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-bcopy.c b/string/test-bcopy.c
index 60697b2..05e748d 100644
--- a/string/test-bcopy.c
+++ b/string/test-bcopy.c
@@ -1,5 +1,5 @@
/* Test and measure bcopy functions.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-bzero.c b/string/test-bzero.c
index 8f12a61..8024be9 100644
--- a/string/test-bzero.c
+++ b/string/test-bzero.c
@@ -1,5 +1,5 @@
/* Test and measure bzero functions.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-endian-file-scope.c b/string/test-endian-file-scope.c
index 00b3408..b960405 100644
--- a/string/test-endian-file-scope.c
+++ b/string/test-endian-file-scope.c
@@ -1,5 +1,5 @@
/* Test endian.h endian-conversion macros accepted at file scope.
- Copyright (C) 2018-2024 Free Software Foundation, Inc.
+ Copyright (C) 2018-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-endian-sign-conversion.c b/string/test-endian-sign-conversion.c
index 799ab82..cd9a1e5 100644
--- a/string/test-endian-sign-conversion.c
+++ b/string/test-endian-sign-conversion.c
@@ -1,5 +1,5 @@
/* Test endian.h endian-conversion macros work with -Wsign-conversion.
- Copyright (C) 2018-2024 Free Software Foundation, Inc.
+ Copyright (C) 2018-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-endian-types.c b/string/test-endian-types.c
index a0ff971..6c49b81 100644
--- a/string/test-endian-types.c
+++ b/string/test-endian-types.c
@@ -1,5 +1,5 @@
/* Test endian.h endian-conversion macros always return the correct type.
- Copyright (C) 2017-2024 Free Software Foundation, Inc.
+ Copyright (C) 2017-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-explicit_bzero.c b/string/test-explicit_bzero.c
index b7263b2..c267e28 100644
--- a/string/test-explicit_bzero.c
+++ b/string/test-explicit_bzero.c
@@ -1,5 +1,5 @@
/* Test and measure explicit_bzero.
- Copyright (C) 2016-2024 Free Software Foundation, Inc.
+ Copyright (C) 2016-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-ffs.c b/string/test-ffs.c
index 376da94..3493cca 100644
--- a/string/test-ffs.c
+++ b/string/test-ffs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memccpy.c b/string/test-memccpy.c
index 6058439..ed626e7 100644
--- a/string/test-memccpy.c
+++ b/string/test-memccpy.c
@@ -1,5 +1,5 @@
/* Test and measure memccpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memchr.c b/string/test-memchr.c
index 6efe814..aaf9a6d 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -1,5 +1,5 @@
/* Test memchr functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 6955bff..5b713fe 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -1,5 +1,5 @@
/* Test and measure memcmp functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c
index fe257a9..e7a6e58 100644
--- a/string/test-memcmpeq.c
+++ b/string/test-memcmpeq.c
@@ -1,5 +1,5 @@
/* Test and measure __memcmpeq functions.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memcpy-large.c b/string/test-memcpy-large.c
index 13cfe1f..66b4eb5 100644
--- a/string/test-memcpy-large.c
+++ b/string/test-memcpy-large.c
@@ -1,5 +1,5 @@
/* Test and measure memcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memcpy-support.h b/string/test-memcpy-support.h
index 692554f..a80e6db 100644
--- a/string/test-memcpy-support.h
+++ b/string/test-memcpy-support.h
@@ -1,5 +1,5 @@
/* Support for testing and measuring memcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memcpy.c b/string/test-memcpy.c
index cdddeaf..30c0c9d 100644
--- a/string/test-memcpy.c
+++ b/string/test-memcpy.c
@@ -1,5 +1,5 @@
/* Test and measure memcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memmem.c b/string/test-memmem.c
index c99a5b7..9d62823 100644
--- a/string/test-memmem.c
+++ b/string/test-memmem.c
@@ -1,5 +1,5 @@
/* Test and measure memmem functions.
- Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ Copyright (C) 2008-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memmove.c b/string/test-memmove.c
index 8184884..fba3b1e 100644
--- a/string/test-memmove.c
+++ b/string/test-memmove.c
@@ -1,5 +1,5 @@
/* Test and measure memmove functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,7 +47,7 @@ IMPL (memmove, 1)
/* Naive implementation to verify results. */
char *
-inhibit_loop_to_libcall
+test_cc_inhibit_loop_to_libcall
simple_memmove (char *dst, const char *src, size_t n)
{
char *ret = dst;
diff --git a/string/test-mempcpy.c b/string/test-mempcpy.c
index f00d07a..83a34d2 100644
--- a/string/test-mempcpy.c
+++ b/string/test-mempcpy.c
@@ -1,5 +1,5 @@
/* Test and measure mempcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memrchr.c b/string/test-memrchr.c
index 6c300c8..a6551a6 100644
--- a/string/test-memrchr.c
+++ b/string/test-memrchr.c
@@ -1,5 +1,5 @@
/* Test and measure memrchr functions.
- Copyright (C) 2013-2024 Free Software Foundation, Inc.
+ Copyright (C) 2013-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-memset.c b/string/test-memset.c
index b49a2b6..19c6138 100644
--- a/string/test-memset.c
+++ b/string/test-memset.c
@@ -1,5 +1,5 @@
/* Test memset functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -64,7 +64,7 @@ IMPL (MEMSET, 1)
/* Naive implementation to verify results. */
CHAR *
-inhibit_loop_to_libcall
+test_cc_inhibit_loop_to_libcall
SIMPLE_MEMSET (CHAR *s, int c, size_t n)
{
CHAR *r = s, *end = s + n;
diff --git a/string/test-memswap.c b/string/test-memswap.c
index 2f0a14e..ab10cff 100644
--- a/string/test-memswap.c
+++ b/string/test-memswap.c
@@ -1,5 +1,5 @@
/* Test and measure memcpy functions.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-rawmemchr.c b/string/test-rawmemchr.c
index ecb2d1d..e8941a6 100644
--- a/string/test-rawmemchr.c
+++ b/string/test-rawmemchr.c
@@ -1,5 +1,5 @@
/* Test and measure memchr functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-sig_np.c b/string/test-sig_np.c
index 88042f6..4b6bf02 100644
--- a/string/test-sig_np.c
+++ b/string/test-sig_np.c
@@ -1,5 +1,5 @@
/* Test and sigabbrev_np and sigdescr_np.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-stpcpy.c b/string/test-stpcpy.c
index b04436b..0d43924 100644
--- a/string/test-stpcpy.c
+++ b/string/test-stpcpy.c
@@ -1,5 +1,5 @@
/* Test stpcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-stpncpy.c b/string/test-stpncpy.c
index 62e11db..fdd6c94 100644
--- a/string/test-stpncpy.c
+++ b/string/test-stpncpy.c
@@ -1,5 +1,5 @@
/* Test and measure stpncpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c
index 3fa128d..2ddabb0 100644
--- a/string/test-strcasecmp.c
+++ b/string/test-strcasecmp.c
@@ -1,5 +1,5 @@
/* Test and measure strcasecmp functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c
index 8aa9d40..aaf7406 100644
--- a/string/test-strcasestr.c
+++ b/string/test-strcasestr.c
@@ -1,5 +1,5 @@
/* Test and measure strcasestr functions.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcat.c b/string/test-strcat.c
index 1accec7..b123fc0 100644
--- a/string/test-strcat.c
+++ b/string/test-strcat.c
@@ -1,5 +1,5 @@
/* Test strcat functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strchr.c b/string/test-strchr.c
index c795eac..765d69e 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -1,5 +1,5 @@
/* Test STRCHR functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -255,6 +255,69 @@ check1 (void)
check_result (impl, s, c, exp_result);
}
+static void
+check2 (void)
+{
+ CHAR *s = (CHAR *) (buf1 + getpagesize () - 4 * sizeof (CHAR));
+ CHAR *s_begin = (CHAR *) (buf1 + getpagesize () - 64);
+#ifndef USE_FOR_STRCHRNUL
+ CHAR *exp_result = NULL;
+#else
+ CHAR *exp_result = s + 1;
+#endif
+ CHAR val = 0x12;
+ for (; s_begin != s; ++s_begin)
+ *s_begin = val;
+
+ s[0] = val + 1;
+ s[1] = 0;
+ s[2] = val + 1;
+ s[3] = val + 1;
+
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+ s[3] = val;
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+ exp_result = s;
+ s[0] = val;
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+
+ s[3] = val + 1;
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+
+ s[0] = val + 1;
+ s[1] = val + 1;
+ s[2] = val + 1;
+ s[3] = val + 1;
+ s[4] = val;
+ exp_result = s + 4;
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+ s[4] = 0;
+#ifndef USE_FOR_STRCHRNUL
+ exp_result = NULL;
+#else
+ exp_result = s + 4;
+#endif
+ {
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s, val, exp_result);
+ }
+}
+
int
test_main (void)
{
@@ -263,7 +326,7 @@ test_main (void)
test_init ();
check1 ();
-
+ check2 ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
diff --git a/string/test-strchrnul.c b/string/test-strchrnul.c
index fd77aec..ff57a13 100644
--- a/string/test-strchrnul.c
+++ b/string/test-strchrnul.c
@@ -1,6 +1,6 @@
/* Test and measure strchrnul function.
- Copyright (C) 2011-2024 Free Software Foundation, Inc.
+ Copyright (C) 2011-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index b392829..1d927ae 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -1,5 +1,5 @@
/* Test and measure strcmp and wcscmp functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcpy.c b/string/test-strcpy.c
index 125d4c1..1e8633f 100644
--- a/string/test-strcpy.c
+++ b/string/test-strcpy.c
@@ -1,5 +1,5 @@
/* Test and measure strcpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strcspn.c b/string/test-strcspn.c
index 121ee32..a16289b 100644
--- a/string/test-strcspn.c
+++ b/string/test-strcspn.c
@@ -1,5 +1,5 @@
/* Test strcspn functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strdup.c b/string/test-strdup.c
index 928dc1f..b178825 100644
--- a/string/test-strdup.c
+++ b/string/test-strdup.c
@@ -1,5 +1,5 @@
/* Test and measure strdup functions.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strerror-errno.c b/string/test-strerror-errno.c
index 4ca7cc6..07a373c 100644
--- a/string/test-strerror-errno.c
+++ b/string/test-strerror-errno.c
@@ -1,6 +1,6 @@
/* BZ #24024 strerror and errno test.
- Copyright (C) 2019-2024 Free Software Foundation, Inc.
+ Copyright (C) 2019-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-string.h b/string/test-string.h
index da108f5..7cdfabf 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -1,5 +1,5 @@
/* Test and measure string and memory functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,16 +40,7 @@ extern impl_t __start_impls[], __stop_impls[];
#undef __USE_STRING_INLINES
-/* We are compiled under _ISOMAC, so libc-symbols.h does not do this
- for us. */
-#include "config.h"
-#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
-# define inhibit_loop_to_libcall \
- __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
-#else
-# define inhibit_loop_to_libcall
-#endif
-
+#include <libc-misc.h>
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/string/test-strlen.c b/string/test-strlen.c
index ef13f12..03a8969 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -1,5 +1,5 @@
/* Test and measure STRLEN functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strncasecmp.c b/string/test-strncasecmp.c
index 4260655..02a24eb 100644
--- a/string/test-strncasecmp.c
+++ b/string/test-strncasecmp.c
@@ -1,5 +1,5 @@
/* Test and measure strncasecmp functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strncat.c b/string/test-strncat.c
index 8b8fcbc..1a55365 100644
--- a/string/test-strncat.c
+++ b/string/test-strncat.c
@@ -1,5 +1,5 @@
/* Test strncat functions.
- Copyright (C) 2011-2024 Free Software Foundation, Inc.
+ Copyright (C) 2011-2025 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index a046e92..da200e5 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -1,5 +1,5 @@
/* Test strncmp and wcsncmp functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strncpy.c b/string/test-strncpy.c
index 39386a3..dcfe9ca 100644
--- a/string/test-strncpy.c
+++ b/string/test-strncpy.c
@@ -1,5 +1,5 @@
/* Test strncpy functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strndup.c b/string/test-strndup.c
index 8c144dd..c044ecf 100644
--- a/string/test-strndup.c
+++ b/string/test-strndup.c
@@ -1,5 +1,5 @@
/* Test strndup functions.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strnlen.c b/string/test-strnlen.c
index a532ebb..acb1c05 100644
--- a/string/test-strnlen.c
+++ b/string/test-strnlen.c
@@ -1,5 +1,5 @@
/* Test strlen functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strpbrk.c b/string/test-strpbrk.c
index f26d86f..b988c4e 100644
--- a/string/test-strpbrk.c
+++ b/string/test-strpbrk.c
@@ -1,5 +1,5 @@
/* Test and measure strpbrk functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strrchr.c b/string/test-strrchr.c
index 7014e26..1503a1c 100644
--- a/string/test-strrchr.c
+++ b/string/test-strrchr.c
@@ -1,5 +1,5 @@
/* Test and measure STRCHR functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strspn.c b/string/test-strspn.c
index 1ef620d..bfbf305 100644
--- a/string/test-strspn.c
+++ b/string/test-strspn.c
@@ -1,5 +1,5 @@
/* Test and measure strspn functions.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/test-strstr.c b/string/test-strstr.c
index 1eebdbc..72d0fbc 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -1,5 +1,5 @@
/* Test and measure strstr functions.
- Copyright (C) 2010-2024 Free Software Foundation, Inc.
+ Copyright (C) 2010-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/testcopy.c b/string/testcopy.c
index 029a9b9..4c34c1e 100644
--- a/string/testcopy.c
+++ b/string/testcopy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1990-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1990-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tester.c b/string/tester.c
index 47f6aeb..33a77d5 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -1,5 +1,5 @@
/* Tester for string functions.
- Copyright (C) 1995-2024 Free Software Foundation, Inc.
+ Copyright (C) 1995-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,12 +50,23 @@ DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
#include <strings.h>
#include <fcntl.h>
+static __typeof (bzero) * volatile bzero_indirect = bzero;
+static __typeof (memset) * volatile memset_indirect = memset;
+
+#undef bzero
+#undef memset
+
+#define bzero bzero_indirect
+#define memset memset_indirect
+
/* This file tests a range of corner cases of string functions,
including cases where truncation occurs or where sizes specified
are larger than the actual buffers, which result in various
warnings. */
DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds");
+#if __GNUC_PREREQ (5, 0)
DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args");
+#endif
#if __GNUC_PREREQ (7, 0)
DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict");
DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
diff --git a/string/tst-bswap.c b/string/tst-bswap.c
index 517b936..db97874 100644
--- a/string/tst-bswap.c
+++ b/string/tst-bswap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-cmp.c b/string/tst-cmp.c
index 9f881b6..bb40f4f 100644
--- a/string/tst-cmp.c
+++ b/string/tst-cmp.c
@@ -1,5 +1,5 @@
/* Alignment/padding coverage test for string comparison.
- Copyright (C) 2016-2024 Free Software Foundation, Inc.
+ Copyright (C) 2016-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-inlcall.c b/string/tst-inlcall.c
index caea686..42ba1ea 100644
--- a/string/tst-inlcall.c
+++ b/string/tst-inlcall.c
@@ -1,5 +1,5 @@
/* Tester for calling inline string functions.
- Copyright (C) 1998-2024 Free Software Foundation, Inc.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-memmove-overflow.c b/string/tst-memmove-overflow.c
index bceabf1..c5a94d2 100644
--- a/string/tst-memmove-overflow.c
+++ b/string/tst-memmove-overflow.c
@@ -1,5 +1,5 @@
/* Test for signed comparison bug in memmove (bug 25620).
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strcoll-overflow.c b/string/tst-strcoll-overflow.c
index 1486cab..d0430c3 100644
--- a/string/tst-strcoll-overflow.c
+++ b/string/tst-strcoll-overflow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strerror-fail.c b/string/tst-strerror-fail.c
index 2566de5..a6cc3f9 100644
--- a/string/tst-strerror-fail.c
+++ b/string/tst-strerror-fail.c
@@ -1,5 +1,5 @@
/* Check that strerror, strerror_l do not return NULL on failure (bug 30555).
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strerror.c b/string/tst-strerror.c
index ca099e1..5025259 100644
--- a/string/tst-strerror.c
+++ b/string/tst-strerror.c
@@ -1,6 +1,6 @@
/* Test for strerror, strerror_r, and strerror_l.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strlcat.c b/string/tst-strlcat.c
index 97dc6c3..465e430 100644
--- a/string/tst-strlcat.c
+++ b/string/tst-strlcat.c
@@ -1,5 +1,5 @@
/* Test the strlcat function.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strlcat2.c b/string/tst-strlcat2.c
index 1ec26a2..3e7546f 100644
--- a/string/tst-strlcat2.c
+++ b/string/tst-strlcat2.c
@@ -1,5 +1,5 @@
/* Test strlcat functions.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
diff --git a/string/tst-strlcpy.c b/string/tst-strlcpy.c
index 279c460..73cddae 100644
--- a/string/tst-strlcpy.c
+++ b/string/tst-strlcpy.c
@@ -1,5 +1,5 @@
/* Test the strlcpy function.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strlcpy2.c b/string/tst-strlcpy2.c
index 3f5a86e..75d3505 100644
--- a/string/tst-strlcpy2.c
+++ b/string/tst-strlcpy2.c
@@ -1,5 +1,5 @@
/* Test strlcpy functions.
- Copyright (C) 2023-2024 Free Software Foundation, Inc.
+ Copyright (C) 2023-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strsignal.c b/string/tst-strsignal.c
index 8412db9..ef24a27 100644
--- a/string/tst-strsignal.c
+++ b/string/tst-strsignal.c
@@ -1,6 +1,6 @@
/* Test for strsignal.
- Copyright (C) 2020-2024 Free Software Foundation, Inc.
+ Copyright (C) 2020-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-strtok_r.c b/string/tst-strtok_r.c
index 201d5ee..4d3b391 100644
--- a/string/tst-strtok_r.c
+++ b/string/tst-strtok_r.c
@@ -1,5 +1,5 @@
/* Test strtok_r regression for BZ #14229.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c
index 2392eaa..7f5fbc7 100644
--- a/string/tst-xbzero-opt.c
+++ b/string/tst-xbzero-opt.c
@@ -1,5 +1,5 @@
/* Test that explicit_bzero block clears are not optimized out.
- Copyright (C) 2016-2024 Free Software Foundation, Inc.
+ Copyright (C) 2016-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -97,7 +97,7 @@ static const unsigned char test_pattern[16] =
static ucontext_t uc_main, uc_co;
-static __attribute__ ((noinline, noclone)) int
+static __attribute_optimization_barrier__ int
use_test_buffer (unsigned char *buf)
{
unsigned int sum = 0;
diff --git a/string/wordcopy.c b/string/wordcopy.c
index 4e77cdb..6926d9d 100644
--- a/string/wordcopy.c
+++ b/string/wordcopy.c
@@ -1,5 +1,5 @@
/* _memcopy.c -- subroutines for memory copy functions.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/string/xpg-strerror.c b/string/xpg-strerror.c
index 8773b13..be6cc4e 100644
--- a/string/xpg-strerror.c
+++ b/string/xpg-strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2025 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or