v2: The GNU C Library 2.16 release plan
Mike Frysinger
vapier@gentoo.org
Wed Aug 15 02:36:00 GMT 2012
On Thursday 14 June 2012 12:56:56 Roland McGrath wrote:
> > > '-D_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 1) ? 2 :
> > > 0)'
> >
> > mmm, i don't think that can work, can it ? it'll expand _FORTIFY_SOURCE
> > into literally "((defined __OPTIMIZE__ && __OPTIMIZE__ > 1) ? 2 : 0)"
> > since the preprocessor isn't recursive.
>
> What's wrong with that? The test is:
>
> #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
>
> When _FORTIFY_SOURCE is evaluated it should work fine.
> (Actually it should be > 0, not 1.)
>
> This works as expected both with and without -DNOTDEF=1:
>
> #define TEST ((defined NOTDEF && NOTDEF > 0) ? 2 : 0)
> #if defined TEST && TEST > 0
> #warning set
> #else
> #warning not set
> #endif
i don't recall exactly how i tested it before, but this seems to work:
cpp_define (pfile,
"_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)");
so i'll look at rolling that out
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120815/bf5399c0/attachment.sig>
More information about the Libc-alpha
mailing list