Using strlcpy if target OS allows it

Joe Buck Joe.Buck@synopsys.COM
Fri May 6 16:25:00 GMT 2005


On Mon, Apr 18, 2005 at 12:13:19PM +0200, Marc Espie wrote:
> I forgot one extra important point. I am in the situation of someone
> needing to implement something on a third party system. 
> 
> Even though I am an OpenBSD developer, there's absolutely no way I am 
> ever going to convince Theo that this warning should be disabled.  So, 
> I have to work with this and make the best libstdc++ I can out of this.

I understand.  That's why I said you'd probably still need some local
patches.

However, you'll want to take care in how you do those local patches.
For example, apparently one or two of the tests is/are checking for the
proper declaration of the "str" functions, that is, they are testing
that strcpy exists.  If you change that test to test for a function that
isn't in ISO C++ instead, it seems that would be wrong, so it would be
better to change the test harness to ignore complaints about use of strcpy
by tests.  We can still get rid of the strcpy calls in the library itself,
as using memcpy is more efficient (since strlen has already been called).




More information about the Libstdc++ mailing list