Gnulib update via admin/merge-gnulib

This commit is contained in:
Paul Eggert 2022-05-05 15:36:33 -07:00
parent 7e9d364b66
commit 9007e10a0f
9 changed files with 48 additions and 11 deletions

View file

@ -164,13 +164,13 @@
|| (__builtin_constant_p (__l) && (__l) > 0))
/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
condition can be folded to a constant and if it is true. The -1 check is
redundant because since it implies that __glibc_safe_len_cond is true. */
condition can be folded to a constant and if it is true, or unknown (-1) */
#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
(__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
__s, __osz)) \
&& __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
((__osz) == (__SIZE_TYPE__) -1 \
|| (__glibc_unsigned_or_positive (__l) \
&& __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
(__s), (__osz))) \
&& __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz))))
/* Conversely, we know at compile time that the length is unsafe if the
__L * __S <= __OBJSZ condition can be folded to a constant and if it is

View file

@ -121,6 +121,7 @@
# undef __attr_dealloc
# undef __attr_dealloc_free
# undef __attribute__
# undef __attribute_alloc_align__
# undef __attribute_alloc_size__
# undef __attribute_artificial__
# undef __attribute_const__
@ -129,6 +130,7 @@
# undef __attribute_format_arg__
# undef __attribute_format_strfmon__
# undef __attribute_malloc__
# undef __attribute_maybe_unused__
# undef __attribute_noinline__
# undef __attribute_nonstring__
# undef __attribute_pure__
@ -142,16 +144,24 @@
# undef __extern_always_inline
# undef __extern_inline
# undef __flexarr
# undef __fortified_attr_access
# undef __fortify_function
# undef __glibc_c99_flexarr_available
# undef __glibc_fortify
# undef __glibc_fortify_n
# undef __glibc_has_attribute
# undef __glibc_has_builtin
# undef __glibc_has_extension
# undef __glibc_likely
# undef __glibc_macro_warning
# undef __glibc_macro_warning1
# undef __glibc_objsize
# undef __glibc_objsize0
# undef __glibc_safe_len_cond
# undef __glibc_safe_or_unknown_len
# undef __glibc_unlikely
# undef __glibc_unsafe_len
# undef __glibc_unsigned_or_positive
# undef __inline
# undef __ptr_t
# undef __restrict
@ -159,6 +169,7 @@
# undef __va_arg_pack
# undef __va_arg_pack_len
# undef __warnattr
# undef __wur
/* Include our copy of glibc <sys/cdefs.h>. */
# include <cdefs.h>

View file

@ -24,6 +24,9 @@
#include <stdint.h>
# if HAVE_OPENSSL_MD5
# ifndef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */
# endif
# include <openssl/md5.h>
# endif

View file

@ -2038,15 +2038,25 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
}
switch (c)
{
case '-':
token->type = OP_CHARSET_RANGE;
break;
case ']':
token->type = OP_CLOSE_BRACKET;
break;
case '^':
token->type = OP_NON_MATCH_LIST;
break;
case '-':
/* In V7 Unix grep and Unix awk and mawk, [...---...]
(3 adjacent minus signs) stands for a single minus sign.
Support that without breaking anything else. */
if (! (re_string_cur_idx (input) + 2 < re_string_length (input)
&& re_string_peek_byte (input, 1) == '-'
&& re_string_peek_byte (input, 2) == '-'))
{
token->type = OP_CHARSET_RANGE;
break;
}
re_string_skip_bytes (input, 2);
FALLTHROUGH;
default:
token->type = CHARACTER;
}

View file

@ -23,6 +23,9 @@
# include <stdint.h>
# if HAVE_OPENSSL_SHA1
# ifndef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */
# endif
# include <openssl/sha.h>
# endif

View file

@ -22,6 +22,9 @@
# include <stdint.h>
# if HAVE_OPENSSL_SHA256
# ifndef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */
# endif
# include <openssl/sha.h>
# endif

View file

@ -22,6 +22,9 @@
# include "u64.h"
# if HAVE_OPENSSL_SHA512
# ifndef OPENSSL_API_COMPAT
# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */
# endif
# include <openssl/sha.h>
# endif

View file

@ -184,7 +184,11 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# undef free
# define free rpl_free
# endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
# else
_GL_FUNCDECL_RPL (free, void, (void *ptr));
# endif
_GL_CXXALIAS_RPL (free, void, (void *ptr));
# else
_GL_CXXALIAS_SYS (free, void, (void *ptr));

View file

@ -583,7 +583,7 @@ _GL_FUNCDECL_RPL (strndup, char *,
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
# else
# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11
# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
_GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n)
_GL_ARG_NONNULL ((1))
@ -593,7 +593,7 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
# endif
_GL_CXXALIASWARN (strndup);
#else
# if __GNUC__ >= 11
# if __GNUC__ >= 11 && !defined strndup
/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
_GL_FUNCDECL_SYS (strndup, char *,
(char const *__s, size_t __n)