headers: Clarify a few aspects relating to Clang wrt the fortification macros

There's no problem in using the "artificial" attribute with Clang,
at least as of Clang 10.0.

Clarify why Clang is excluded for __MINGW_FORTIFY_VA_ARG.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2022-10-31 13:19:05 +02:00
parent 19aa419bb9
commit 22a065d89f

View File

@ -294,7 +294,7 @@
# define __mingw_static_ovr __mingw_ovr
#endif /* __cplusplus */
#if __MINGW_GNUC_PREREQ(4, 3) && !defined(__clang__)
#if __MINGW_GNUC_PREREQ(4, 3) || defined(__clang__)
# define __mingw_attribute_artificial \
__attribute__((__artificial__))
#else
@ -345,7 +345,8 @@
/* If _FORTIFY_SOURCE is enabled, some inline functions may use
__builtin_va_arg_pack(). GCC may report an error if the address
of such a function is used. Set _FORTIFY_VA_ARG=0 in this case. */
of such a function is used. Set _FORTIFY_VA_ARG=0 in this case.
Clang doesn't, as of version 15, yet implement __builtin_va_arg_pack(). */
#if __MINGW_FORTIFY_LEVEL > 0 && __MINGW_GNUC_PREREQ(4, 3) && !defined(__clang__) \
&& (!defined(_FORTIFY_VA_ARG) || _FORTIFY_VA_ARG > 0)
# define __MINGW_FORTIFY_VA_ARG 1