diff options
| author | Paul Eggert | 2020-09-05 17:48:45 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-09-05 17:51:25 -0700 |
| commit | 2bba9cd409ce4b53639328e17da81db8dbda72c7 (patch) | |
| tree | 410719d8bc3e23ea9140f71d81b8b4b7024ea339 /lib | |
| parent | 2c1d8397788c1385debef514c59a6461b2e5408e (diff) | |
| download | emacs-2bba9cd409ce4b53639328e17da81db8dbda72c7.tar.gz emacs-2bba9cd409ce4b53639328e17da81db8dbda72c7.zip | |
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@ | |||
| 442 | GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ | 442 | GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ |
| 443 | GNULIB_STRDUP = @GNULIB_STRDUP@ | 443 | GNULIB_STRDUP = @GNULIB_STRDUP@ |
| 444 | GNULIB_STRERROR = @GNULIB_STRERROR@ | 444 | GNULIB_STRERROR = @GNULIB_STRERROR@ |
| 445 | GNULIB_STRERRORNAME_NP = @GNULIB_STRERRORNAME_NP@ | ||
| 445 | GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ | 446 | GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ |
| 446 | GNULIB_STRFTIME = @GNULIB_STRFTIME@ | 447 | GNULIB_STRFTIME = @GNULIB_STRFTIME@ |
| 447 | GNULIB_STRNCAT = @GNULIB_STRNCAT@ | 448 | GNULIB_STRNCAT = @GNULIB_STRNCAT@ |
| @@ -662,6 +663,7 @@ HAVE_STPCPY = @HAVE_STPCPY@ | |||
| 662 | HAVE_STPNCPY = @HAVE_STPNCPY@ | 663 | HAVE_STPNCPY = @HAVE_STPNCPY@ |
| 663 | HAVE_STRCASESTR = @HAVE_STRCASESTR@ | 664 | HAVE_STRCASESTR = @HAVE_STRCASESTR@ |
| 664 | HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ | 665 | HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ |
| 666 | HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ | ||
| 665 | HAVE_STRPBRK = @HAVE_STRPBRK@ | 667 | HAVE_STRPBRK = @HAVE_STRPBRK@ |
| 666 | HAVE_STRPTIME = @HAVE_STRPTIME@ | 668 | HAVE_STRPTIME = @HAVE_STRPTIME@ |
| 667 | HAVE_STRSEP = @HAVE_STRSEP@ | 669 | HAVE_STRSEP = @HAVE_STRSEP@ |
| @@ -965,6 +967,7 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ | |||
| 965 | REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ | 967 | REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ |
| 966 | REPLACE_STRDUP = @REPLACE_STRDUP@ | 968 | REPLACE_STRDUP = @REPLACE_STRDUP@ |
| 967 | REPLACE_STRERROR = @REPLACE_STRERROR@ | 969 | REPLACE_STRERROR = @REPLACE_STRERROR@ |
| 970 | REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ | ||
| 968 | REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ | 971 | REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ |
| 969 | REPLACE_STRFTIME = @REPLACE_STRFTIME@ | 972 | REPLACE_STRFTIME = @REPLACE_STRFTIME@ |
| 970 | REPLACE_STRNCAT = @REPLACE_STRNCAT@ | 973 | REPLACE_STRNCAT = @REPLACE_STRNCAT@ |
| @@ -2859,6 +2862,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H | |||
| 2859 | -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ | 2862 | -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ |
| 2860 | -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ | 2863 | -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ |
| 2861 | -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ | 2864 | -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ |
| 2865 | -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ | ||
| 2862 | -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ | 2866 | -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ |
| 2863 | -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ | 2867 | -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ |
| 2864 | -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ | 2868 | -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 | |||
| 2883 | -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ | 2887 | -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ |
| 2884 | -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ | 2888 | -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ |
| 2885 | -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ | 2889 | -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ |
| 2890 | -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ | ||
| 2886 | -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ | 2891 | -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ |
| 2887 | -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ | 2892 | -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ |
| 2888 | -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ | 2893 | -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 | |||
| 2900 | -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ | 2905 | -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ |
| 2901 | -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ | 2906 | -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ |
| 2902 | -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ | 2907 | -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ |
| 2908 | -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ | ||
| 2903 | -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ | 2909 | -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ |
| 2904 | -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ | 2910 | -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ |
| 2905 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ | 2911 | -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 - " | |||
| 1045 | # endif | 1045 | # endif |
| 1046 | #endif | 1046 | #endif |
| 1047 | 1047 | ||
| 1048 | /* Return the name of the system error code ERRNUM. */ | ||
| 1049 | #if @GNULIB_STRERRORNAME_NP@ | ||
| 1050 | # if @REPLACE_STRERRORNAME_NP@ | ||
| 1051 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 1052 | # undef strerrorname_np | ||
| 1053 | # define strerrorname_np rpl_strerrorname_np | ||
| 1054 | # endif | ||
| 1055 | _GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); | ||
| 1056 | _GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); | ||
| 1057 | # else | ||
| 1058 | # if !@HAVE_STRERRORNAME_NP@ | ||
| 1059 | _GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); | ||
| 1060 | # endif | ||
| 1061 | _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); | ||
| 1062 | # endif | ||
| 1063 | _GL_CXXALIASWARN (strerrorname_np); | ||
| 1064 | #elif defined GNULIB_POSIXCHECK | ||
| 1065 | # undef strerrorname_np | ||
| 1066 | # if HAVE_RAW_DECL_STRERRORNAME_NP | ||
| 1067 | _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " | ||
| 1068 | "use gnulib module strerrorname_np for portability"); | ||
| 1069 | # endif | ||
| 1070 | #endif | ||
| 1071 | |||
| 1048 | /* Return an abbreviation string for the signal number SIG. */ | 1072 | /* Return an abbreviation string for the signal number SIG. */ |
| 1049 | #if @GNULIB_SIGABBREV_NP@ | 1073 | #if @GNULIB_SIGABBREV_NP@ |
| 1050 | # if ! @HAVE_SIGABBREV_NP@ | 1074 | # 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> | |||
| 246 | 246 | ||
| 247 | /* @assert.h omit start@ */ | 247 | /* @assert.h omit start@ */ |
| 248 | 248 | ||
| 249 | #if defined __has_builtin | ||
| 250 | /* <https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions> */ | ||
| 251 | # define _GL_HAS_BUILTIN_ASSUME __has_builtin (__builtin_assume) | ||
| 252 | #else | ||
| 253 | # define _GL_HAS_BUILTIN_ASSUME 0 | ||
| 254 | #endif | ||
| 255 | |||
| 256 | #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) | 249 | #if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) |
| 257 | # define _GL_HAS_BUILTIN_TRAP 1 | 250 | # define _GL_HAS_BUILTIN_TRAP 1 |
| 258 | #elif defined __has_builtin | 251 | #elif defined __has_builtin |
| @@ -312,36 +305,14 @@ template <int w> | |||
| 312 | 305 | ||
| 313 | Although assuming R can help a compiler generate better code or | 306 | Although assuming R can help a compiler generate better code or |
| 314 | diagnostics, performance can suffer if R uses hard-to-optimize | 307 | diagnostics, performance can suffer if R uses hard-to-optimize |
| 315 | features such as function calls not inlined by the compiler. */ | 308 | features such as function calls not inlined by the compiler. |
| 316 | 309 | ||
| 317 | /* Use __builtin_assume in preference to __builtin_unreachable, because | 310 | Avoid Clang's __builtin_assume, as it breaks GNU Emacs master |
| 318 | in clang versions 8.0.x and older, the definition based on | 311 | as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see |
| 319 | __builtin_assume has an effect on optimizations, whereas the definition | 312 | <https://bugs.gnu.org/43152#71>. It's not known whether this breakage |
| 320 | based on __builtin_unreachable does not. (GCC so far has only | 313 | is a Clang bug or an Emacs bug; play it safe for now. */ |
| 321 | __builtin_unreachable.) */ | 314 | |
| 322 | #if _GL_HAS_BUILTIN_ASSUME | 315 | #if _GL_HAS_BUILTIN_UNREACHABLE |
| 323 | /* Use __builtin_constant_p to help clang's data-flow analysis for the case | ||
| 324 | assume (0). | ||
| 325 | Use a temporary variable, to avoid a clang warning | ||
| 326 | "the argument to '__builtin_assume' has side effects that will be discarded" | ||
| 327 | if R contains invocations of functions not marked as 'const'. | ||
| 328 | The type of the temporary variable can't be __typeof__ (R), because that | ||
| 329 | does not work on bit field expressions. Use '_Bool' or 'bool' as type | ||
| 330 | instead. */ | ||
| 331 | # if defined __cplusplus | ||
| 332 | # define assume(R) \ | ||
| 333 | (__builtin_constant_p (R) && !(R) \ | ||
| 334 | ? (void) __builtin_unreachable () \ | ||
| 335 | : (void) ({ bool _gl_verify_temp = (R); \ | ||
| 336 | __builtin_assume (_gl_verify_temp); })) | ||
| 337 | # else | ||
| 338 | # define assume(R) \ | ||
| 339 | (__builtin_constant_p (R) && !(R) \ | ||
| 340 | ? (void) __builtin_unreachable () \ | ||
| 341 | : (void) ({ _Bool _gl_verify_temp = (R); \ | ||
| 342 | __builtin_assume (_gl_verify_temp); })) | ||
| 343 | # endif | ||
| 344 | #elif _GL_HAS_BUILTIN_UNREACHABLE | ||
| 345 | # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) | 316 | # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) |
| 346 | #elif 1200 <= _MSC_VER | 317 | #elif 1200 <= _MSC_VER |
| 347 | # define assume(R) __assume (R) | 318 | # define assume(R) __assume (R) |