mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
stdio: disable fortify of snprintf/sprintf for clang
clang does not have builtin function `__builtin_va_arg_pack` Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
c07d9dc900
commit
f107b3f5d5
@@ -127,7 +127,9 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define fortify_va_arg_pack __builtin_va_arg_pack
|
||||
# if !defined(__clang__)
|
||||
# define fortify_va_arg_pack __builtin_va_arg_pack
|
||||
# endif
|
||||
# define fortify_real(fn) __typeof__(fn) __real_##fn __asm__(#fn)
|
||||
# define fortify_function(fn) fortify_real(fn); \
|
||||
extern __inline__ no_builtin(#fn) \
|
||||
|
||||
@@ -318,6 +318,7 @@ fortify_function(vsprintf) int vsprintf(FAR char *dest,
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef fortify_va_arg_pack
|
||||
fortify_function(snprintf) int snprintf(FAR char *buf, size_t size,
|
||||
FAR const IPTR char *format, ...)
|
||||
{
|
||||
@@ -336,6 +337,7 @@ fortify_function(sprintf) int sprintf(FAR char *buf,
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
||||
Reference in New Issue
Block a user