From 249492e08adbf034976770ab3b021ba093a2ab18 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 18 Mar 2023 14:01:02 +0100 Subject: Make use of __builtin_dynamic_object_size GCC and Clang provide __builtin_dynamic_object_size (see documentation: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html), so we should make use of it when its available. --- include/sys/select.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/sys/select.h') diff --git a/include/sys/select.h b/include/sys/select.h index bcee8be..1f19672 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -30,7 +30,7 @@ extern "C" { static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) void __fortify_FD_CLR(int __f, fd_set *__s) { - size_t __b = __builtin_object_size(__s, 0); + size_t __b = __bos(__s, 0); if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) __builtin_trap(); @@ -40,7 +40,7 @@ void __fortify_FD_CLR(int __f, fd_set *__s) static __inline__ __attribute__((__always_inline__,__gnu_inline__,__artificial__)) void __fortify_FD_SET(int __f, fd_set *__s) { - size_t __b = __builtin_object_size(__s, 0); + size_t __b = __bos(__s, 0); if (__f < 0 || __f >= FD_SETSIZE || __b < sizeof(fd_set)) __builtin_trap(); -- cgit v1.3