diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-07-26 14:29:47 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-07-26 14:29:47 +0300 |
commit | 3bee4587c5d57155c41dda16d1a414b6acb5a477 (patch) | |
tree | 05571724e6766cfca7f667252b6cd21fa619a44d | |
parent | d45cad0210ddba7658a1f894a82167f87d7abb3a (diff) | |
download | egawk-3bee4587c5d57155c41dda16d1a414b6acb5a477.tar.gz egawk-3bee4587c5d57155c41dda16d1a414b6acb5a477.tar.bz2 egawk-3bee4587c5d57155c41dda16d1a414b6acb5a477.zip |
Sync support files from GNULIB.
-rw-r--r-- | support/ChangeLog | 6 | ||||
-rw-r--r-- | support/cdefs.h | 2 | ||||
-rw-r--r-- | support/dfa.c | 2 | ||||
-rw-r--r-- | support/libc-config.h | 18 | ||||
-rw-r--r-- | support/localeinfo.c | 4 | ||||
-rw-r--r-- | support/localeinfo.h | 2 | ||||
-rw-r--r-- | support/regcomp.c | 2 | ||||
-rw-r--r-- | support/regex.h | 2 | ||||
-rw-r--r-- | support/regex_internal.c | 2 | ||||
-rw-r--r-- | support/regexec.c | 2 | ||||
-rw-r--r-- | support/verify.h | 49 |
11 files changed, 64 insertions, 27 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index 035a719f..5a6c4342 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,9 @@ +2020-07-26 Arnold D. Robbins <arnold@skeeve.com> + + * cdefs.h, dfa.c, libc-config.h, localeinfo.c, localeinfo.h, + regcomp.c, regex.h, regex_internal.c, regexec.c, + verify.h: Sync from GNULIB. Mostly copyright updates. + 2020-06-07 Arnold D. Robbins <arnold@skeeve.com> * dfa.c: Revert changes of 26 April 2020. It causes diff --git a/support/cdefs.h b/support/cdefs.h index 4f921754..21583795 100644 --- a/support/cdefs.h +++ b/support/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2019 Free Software Foundation, Inc. +/* Copyright (C) 1992-2020 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/support/dfa.c b/support/dfa.c index 41bf5cc2..3327f627 100644 --- a/support/dfa.c +++ b/support/dfa.c @@ -2465,7 +2465,7 @@ static int compare (const void *a, const void *b) { position const *p = a, *q = b; - return p->index < q->index ? -1 : p->index > q->index; + return (p->index > q->index) - (p->index < q->index); } static void diff --git a/support/libc-config.h b/support/libc-config.h index f24fbfa6..59cfbe5c 100644 --- a/support/libc-config.h +++ b/support/libc-config.h @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2019 Free Software Foundation, Inc. + Copyright 2017-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -55,8 +55,17 @@ #ifndef __glibc_clang_prereq # if defined __clang_major__ && defined __clang_minor__ -# define __glibc_clang_prereq(maj, min) \ - ((maj) < __clang_major__ + ((min) <= __clang_minor__)) +# ifdef __apple_build_version__ +/* Apple for some reason renumbers __clang_major__ and __clang_minor__. + Gnulib code uses only __glibc_clang_prereq (3, 5); map it to + 6000000 <= __apple_build_version__. Support for other calls to + __glibc_clang_prereq can be added here as needed. */ +# define __glibc_clang_prereq(maj, min) \ + ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0) +# else +# define __glibc_clang_prereq(maj, min) \ + ((maj) < __clang_major__ + ((min) <= __clang_minor__)) +# endif # else # define __glibc_clang_prereq(maj, min) 0 # endif @@ -171,4 +180,5 @@ /* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */ #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 -#define versioned_symbol(lib, local, symbol, version) +#define compat_symbol(lib, local, symbol, version) extern int dummy +#define versioned_symbol(lib, local, symbol, version) extern int dummy diff --git a/support/localeinfo.c b/support/localeinfo.c index 694735e2..159ad073 100644 --- a/support/localeinfo.c +++ b/support/localeinfo.c @@ -1,6 +1,6 @@ /* locale information - Copyright 2016-2019 Free Software Foundation, Inc. + Copyright 2016-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,7 +81,7 @@ using_simple_locale (bool multibyte) where the native order is the collating-sequence order but there are multi-character collating elements. */ for (int i = 0; i < UCHAR_MAX; i++) - if (strcoll (((char []) {i, 0}), ((char []) {i + 1, 0})) <= 0) + if (0 <= strcoll (((char []) {i, 0}), ((char []) {i + 1, 0}))) return false; return true; diff --git a/support/localeinfo.h b/support/localeinfo.h index c827a2bf..16f5129d 100644 --- a/support/localeinfo.h +++ b/support/localeinfo.h @@ -1,6 +1,6 @@ /* locale information - Copyright 2016-2019 Free Software Foundation, Inc. + Copyright 2016-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/support/regcomp.c b/support/regcomp.c index 3e8f1e61..93bb0a05 100644 --- a/support/regcomp.c +++ b/support/regcomp.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2019 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. diff --git a/support/regex.h b/support/regex.h index 840e5150..87cce7f5 100644 --- a/support/regex.h +++ b/support/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-2019 Free Software Foundation, Inc. + Copyright (C) 1985, 1989-2020 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/support/regex_internal.c b/support/regex_internal.c index 6aa91160..e1b6b4d5 100644 --- a/support/regex_internal.c +++ b/support/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2019 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. diff --git a/support/regexec.c b/support/regexec.c index 38b6d671..a3ee618c 100644 --- a/support/regexec.c +++ b/support/regexec.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2019 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. diff --git a/support/verify.h b/support/verify.h index afdc1ad8..f1097612 100644 --- a/support/verify.h +++ b/support/verify.h @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2019 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -233,6 +233,22 @@ template <int w> /* @assert.h omit start@ */ +#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) +# define _GL_HAS_BUILTIN_TRAP 1 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap) +#else +# define _GL_HAS_BUILTIN_TRAP 0 +#endif + +#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__) +# define _GL_HAS_BUILTIN_UNREACHABLE 1 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable) +#else +# define _GL_HAS_BUILTIN_UNREACHABLE 0 +#endif + /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike assert (R), there is no run-time overhead. @@ -260,24 +276,29 @@ template <int w> # define verify(R) _GL_VERIFY (R, "verify (" #R ")", -) #endif -#ifndef __has_builtin -# define __has_builtin(x) 0 -#endif - /* Assume that R always holds. Behavior is undefined if R is false, - fails to evaluate, or has side effects. 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. */ + fails to evaluate, or has side effects. + + 'assume (R)' is a directive from the programmer telling the + compiler that R is true so the compiler needn't generate code to + test R. This is why 'assume' is in verify.h: it's related to + static checking (in this case, static checking done by the + programmer), not dynamic checking. + + 'assume (R)' can affect compilation of all the code, not just code + that happens to be executed after the assume (R) is "executed". + For example, if the code mistakenly does 'assert (R); assume (R);' + the compiler is entitled to optimize away the 'assert (R)'. + + 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. */ -#if (__has_builtin (__builtin_unreachable) \ - || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) +#if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) -#elif ((defined GCC_LINT || defined lint) \ - && (__has_builtin (__builtin_trap) \ - || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) +#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP /* Doing it this way helps various packages when configured with --enable-gcc-warnings, which compiles with -Dlint. It's nicer when 'assume' silences warnings even with older GCCs. */ |