summaryrefslogtreecommitdiff
path: root/lib/cdefs.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-05-05 15:36:33 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-05-05 15:37:40 -0700
commit9007e10a0fc94190404c6a988f7d52d162901940 (patch)
treebec4b170622a185f9feacde07e864f32c7ca71b2 /lib/cdefs.h
parent7e9d364b663613fd907f92de31e996463ef7d03c (diff)
downloademacs-9007e10a0fc94190404c6a988f7d52d162901940.tar.gz
Gnulib update via admin/merge-gnulib
Diffstat (limited to 'lib/cdefs.h')
-rw-r--r--lib/cdefs.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/cdefs.h b/lib/cdefs.h
index cb2514504f1..7b8ed5b344b 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -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