summaryrefslogtreecommitdiff
path: root/lib/string.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-12-17 23:11:55 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-18 00:24:13 -0800
commitbda755bf92b5fa0dfe25da173b30e1002e95b774 (patch)
treea9aa1b5520a48c93a1702b39c1b2f22a32c46805 /lib/string.in.h
parent5a344d90c53d681ed98ab03ad3e218a3c6561108 (diff)
downloademacs-bda755bf92b5fa0dfe25da173b30e1002e95b774.tar.gz
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'lib/string.in.h')
-rw-r--r--lib/string.in.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/string.in.h b/lib/string.in.h
index e56f6db0c9c..21356914e21 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -347,6 +347,23 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
# endif
#endif
+/* Overwrite a block of memory. The compiler will not optimize
+ effects away, even if the block is dead after the call. */
+#if @GNULIB_MEMSET_EXPLICIT@
+# if ! @HAVE_MEMSET_EXPLICIT@
+_GL_FUNCDECL_SYS (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
+_GL_CXXALIASWARN (memset_explicit);
+#elif defined GNULIB_POSIXCHECK
+# undef memset_explicit
+# if HAVE_RAW_DECL_MEMSET_EXPLICIT
+_GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - "
+ "use gnulib module memset_explicit for portability");
+# endif
+#endif
+
/* Find the first occurrence of C in S. More efficient than
memchr(S,C,N), at the expense of undefined behavior if C does not
occur within N bytes. */