[tlbuild] tl18 trials

Mojca Miklavec mojca.miklavec.lists at gmail.com
Wed Feb 28 10:31:33 CET 2018


On 28 February 2018 at 01:29, Akira Kakuto wrote:
>> According to grep, strnlen is used in only one place in zziplib, namely
>> the _zzip_strndup function defined in
>> zziplib/zziplib-src/zzip/__string.h, only in the case where strndup is
>> not available (lines 17ff).
>
>
> Thanks Apostolos, Bruno, and Karl.
> I tried in r46760.  Mojca, please test if it is ok or not.

Thank you, it works on Solaris 10, but I strongly suspect it might
fail on Solaris 11 (I can test that as well) as well as on random
other platforms that might lack the function. To me this doesn't look
like the correct solution, it would be much better to do it in a
similar way as for example in gnuplot where configure.ac contains
    AC_CHECK_FUNCS(... strnlen ...)
and then the code uses

#ifndef HAVE_STRNLEN
size_t
strnlen(const char *str, size_t n)
{
    const char * stop = (char *)memchr(str, '\0', n);
    return stop ? stop - str : n;
}
#endif

A check for Solaris seems strange.

Mojca


More information about the tlbuild mailing list