|| (__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
# undef __attr_dealloc
# undef __attr_dealloc_free
# undef __attribute__
+# undef __attribute_alloc_align__
# undef __attribute_alloc_size__
# undef __attribute_artificial__
# undef __attribute_const__
# undef __attribute_format_arg__
# undef __attribute_format_strfmon__
# undef __attribute_malloc__
+# undef __attribute_maybe_unused__
# undef __attribute_noinline__
# undef __attribute_nonstring__
# undef __attribute_pure__
# 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
# undef __va_arg_pack
# undef __va_arg_pack_len
# undef __warnattr
+# undef __wur
/* Include our copy of glibc <sys/cdefs.h>. */
# include <cdefs.h>
#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
}
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;
}
# 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
# 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
# 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
# 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));
_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))
# 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)