[PATCH v5 1/2] string: _FORTIFY_SOURCE=3 using __builtin_dynamic_object_size
Siddhesh Poyarekar
siddhesh@sourceware.org
Sat Dec 19 06:22:33 GMT 2020
On 12/19/20 3:42 AM, Paul Eggert wrote:
> Also, the warning shouldn't imply that one should use LLVM 9.0 or later.
> It's not our job to recommend LLVM versions, plus that warning's wording
> would likely become dated anyway.
/me nods
> Also, there should be spaces before the parens.
>
> How about something like the following instead? It uses simpler and
> more future-proof warnings, and I find it easier to follow:
>
> +# elif _FORTIFY_SOURCE > 2 && __glibc_clang_prereq (9, 0)
> +# if _FORTIFY_SOURCE > 3
> +# warning _FORTIFY_SOURCE > 3 is treated like 3 on this platform
> +# endif
> +# define __USE_FORTIFY_LEVEL 3
> # elif _FORTIFY_SOURCE > 1
> +# if _FORTIFY_SOURCE > 2
> +# warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform
> +# endif
> # define __USE_FORTIFY_LEVEL 2
Thanks, I like this, I'll post a v6 with the update.
Siddhesh
More information about the Libc-alpha
mailing list