mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
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 <chenxiaoyi@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
ad422684d4
commit
c07d9dc900
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user