[PATCH v4 1/2] string: _FORTIFY_SOURCE=3 using __builtin_dynamic_object_size
Jakub Jelinek
jakub@redhat.com
Tue Dec 15 19:05:59 GMT 2020
On Wed, Dec 16, 2020 at 12:31:02AM +0530, Siddhesh Poyarekar wrote:
> On 12/16/20 12:03 AM, Jakub Jelinek via Libc-alpha wrote:
> > On Tue, Dec 15, 2020 at 11:52:37PM +0530, Siddhesh Poyarekar wrote:
> > > -# elif _FORTIFY_SOURCE > 1
> > > +# elif _FORTIFY_SOURCE == 3 && !__glibc_clang_prereq(9, 0)
> > > +# warning _FORTIFY_SOURCE > 2 requires LLVM 9.0 or later, falling back to 2
> >
> > The == 3 above should be really > 2 instead.
>
> I wrote it this way to maintain consistency with what the code has been
> doing so far, which is to silently lower the spurious high values (e.g.
> _FORTIFY_SOURCE=8) to the nearest supported one and only warn for ==3 for
> non-clang. Do you think we should change that? If yes then we need a
What you wrote will be silent for -D_FORTIFY_SOURCE=4, but will be noisy
for -D_FORTIFY_SOURCE=3 (both with gcc or with clang < 9).
That is strange.
Jakub
More information about the Libc-alpha
mailing list