This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using strlcpy if target OS allows it


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]