This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Using strlcpy if target OS allows it
- From: Marc Espie <espie at nerim dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sat, 16 Apr 2005 14:09:46 +0200
- Subject: Using strlcpy if target OS allows it
- Reply-to: espie at nerim dot net
What's the correct way to test for a libc function on the target OS ?
The reason I'm asking is that OpenBSD has actually started killing uses
of strcpy in its base system, for auditing purposes.
libstdc++ has a number of calls to strcpy, which can be replaced by
strlcpy, if the host OS allows it...
I think I could put something like _GLIBCPP_HAS_STRLCPY in the
config/os/openbsd/os_defines.h I'm writing, but there may be a cleaner way.
This is not just a pedantic issue with respect to libstdc++...
The linker now warns about uses of strcpy, which means that the whole
libstdc++ testsuite fails on OpenBSD now.