mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +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:
@@ -113,10 +113,6 @@
|
|||||||
# warning requires compiling with optimization (-O2 or higher)
|
# warning requires compiling with optimization (-O2 or higher)
|
||||||
# endif
|
# endif
|
||||||
# if CONFIG_FORTIFY_SOURCE == 3
|
# 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)
|
# define fortify_size(__o, type) __builtin_dynamic_object_size(__o, type)
|
||||||
# else
|
# else
|
||||||
# define fortify_size(__o, type) __builtin_object_size(__o, type)
|
# define fortify_size(__o, type) __builtin_object_size(__o, type)
|
||||||
|
|||||||
Reference in New Issue
Block a user