From c07d9dc900c1e9165ceef32e14fd35885ed3b6c4 Mon Sep 17 00:00:00 2001 From: chenxiaoyi Date: Wed, 4 Dec 2024 18:02:59 +0800 Subject: [PATCH] compiler: fix fortify for clang The clang compiler has also defined `__GNUC__`, which can't be used to decide the compiler version. And the version used to decide whether the builtin function `__builtin_dynamic_object_size` exist is not correct. Signed-off-by: chenxiaoyi --- include/nuttx/compiler.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 35150a1112a..eb7aabd2a48 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -113,10 +113,6 @@ # warning requires compiling with optimization (-O2 or higher) # endif # if CONFIG_FORTIFY_SOURCE == 3 -# if __GNUC__ < 12 || (defined(__clang__) && __clang_major__ < 12) -# error compiler version less than 12 does not support dynamic object size -# endif - # define fortify_size(__o, type) __builtin_dynamic_object_size(__o, type) # else # define fortify_size(__o, type) __builtin_object_size(__o, type)