]> Savannah Git Hosting - gnulib.git/commit
string: fix build failure on BSD/OSX with FORTIFY_SOURCE
authorPádraig Brady <P@draigBrady.com>
Wed, 27 May 2015 11:59:05 +0000 (12:59 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 27 May 2015 12:25:51 +0000 (13:25 +0100)
commit70e0e9ed738ddc514b09fa486421fc86c31c7e25
tree327fe7008ba9a0df8ccf6f6c42c6e5ae2acafcb8
parentc26527cebbbf42ed1dbc50df0074861e0ebe33dc
string: fix build failure on BSD/OSX with FORTIFY_SOURCE

This avoids a conflict with "FORTIFY_SOURCE" variants
of the string functions when they're replaced on NetBSD-6.0.1
and Darwin-14.3.0 at least.  On these platforms, the system
<string.h> re-includes "string.h" through <strings.h>, before
going on to redefine the "FORTIFY_SOURCE" _chk variants.
For example rpl_strncat is redefined to __builtin___strncat_chk.

Note strncat is being replaced as the configure check is failing
with GCC 4.5.0, due to the builtin strncat failing the check.
I.E. when compiled with -O2 the test fails, but passes when
-fno-builtin-strncat is also specified.  -D_FORTIFY_SOURCE has
no impact on the configure test result.

* lib/string.in.h: Avoid including our "lib/string.h" while
including the system <string.h>.
ChangeLog
lib/string.in.h