diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-09-05 17:48:45 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-09-05 17:51:25 -0700 |
commit | 2bba9cd409ce4b53639328e17da81db8dbda72c7 (patch) | |
tree | 410719d8bc3e23ea9140f71d81b8b4b7024ea339 /lib | |
parent | 2c1d8397788c1385debef514c59a6461b2e5408e (diff) | |
download | emacs-2bba9cd409ce4b53639328e17da81db8dbda72c7.tar.gz |
Update from Gnulib
This incorporates:
2020-09-05 verify: avoid __builtin_assume
2020-08-30 strerrorname_np: New module
2020-08-26 include_next, stdint, time_rz: Change configure message
* lib/gnulib.mk.in: Regenerate.
* lib/string.in.h, lib/verify.h, m4/include_next.m4, m4/stdint.m4:
* m4/string_h.m4, m4/time_rz.m4: Copy from Gnulib.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gnulib.mk.in | 6 | ||||
-rw-r--r-- | lib/string.in.h | 24 | ||||
-rw-r--r-- | lib/verify.h | 45 |
3 files changed, 38 insertions, 37 deletions
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index f564d501222..9953198fb31 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -442,6 +442,7 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERRORNAME_NP = @GNULIB_STRERRORNAME_NP@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRFTIME = @GNULIB_STRFTIME@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ @@ -662,6 +663,7 @@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ @@ -965,6 +967,7 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ @@ -2859,6 +2862,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ @@ -2883,6 +2887,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ @@ -2900,6 +2905,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ diff --git a/lib/string.in.h b/lib/string.in.h index 776133c5eba..9724addef43 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1045,6 +1045,30 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " # endif #endif +/* Return the name of the system error code ERRNUM. */ +#if @GNULIB_STRERRORNAME_NP@ +# if @REPLACE_STRERRORNAME_NP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerrorname_np +# define strerrorname_np rpl_strerrorname_np +# endif +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); +# else +# if !@HAVE_STRERRORNAME_NP@ +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIASWARN (strerrorname_np); +#elif defined GNULIB_POSIXCHECK +# undef strerrorname_np +# if HAVE_RAW_DECL_STRERRORNAME_NP +_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " + "use gnulib module strerrorname_np for portability"); +# endif +#endif + /* Return an abbreviation string for the signal number SIG. */ #if @GNULIB_SIGABBREV_NP@ # if ! @HAVE_SIGABBREV_NP@ diff --git a/lib/verify.h b/lib/verify.h index ca2a1540736..fa1ed717d0e 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -246,13 +246,6 @@ template <int w> /* @assert.h omit start@ */ -#if defined __has_builtin -/* <https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions> */ -# define _GL_HAS_BUILTIN_ASSUME __has_builtin (__builtin_assume) -#else -# define _GL_HAS_BUILTIN_ASSUME 0 -#endif - #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) # define _GL_HAS_BUILTIN_TRAP 1 #elif defined __has_builtin @@ -312,36 +305,14 @@ template <int w> Although assuming R can help a compiler generate better code or diagnostics, performance can suffer if R uses hard-to-optimize - features such as function calls not inlined by the compiler. */ - -/* Use __builtin_assume in preference to __builtin_unreachable, because - in clang versions 8.0.x and older, the definition based on - __builtin_assume has an effect on optimizations, whereas the definition - based on __builtin_unreachable does not. (GCC so far has only - __builtin_unreachable.) */ -#if _GL_HAS_BUILTIN_ASSUME -/* Use __builtin_constant_p to help clang's data-flow analysis for the case - assume (0). - Use a temporary variable, to avoid a clang warning - "the argument to '__builtin_assume' has side effects that will be discarded" - if R contains invocations of functions not marked as 'const'. - The type of the temporary variable can't be __typeof__ (R), because that - does not work on bit field expressions. Use '_Bool' or 'bool' as type - instead. */ -# if defined __cplusplus -# define assume(R) \ - (__builtin_constant_p (R) && !(R) \ - ? (void) __builtin_unreachable () \ - : (void) ({ bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) -# else -# define assume(R) \ - (__builtin_constant_p (R) && !(R) \ - ? (void) __builtin_unreachable () \ - : (void) ({ _Bool _gl_verify_temp = (R); \ - __builtin_assume (_gl_verify_temp); })) -# endif -#elif _GL_HAS_BUILTIN_UNREACHABLE + features such as function calls not inlined by the compiler. + + Avoid Clang's __builtin_assume, as it breaks GNU Emacs master + as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see + <https://bugs.gnu.org/43152#71>. It's not known whether this breakage + is a Clang bug or an Emacs bug; play it safe for now. */ + +#if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) |