[Toybox] [PATCH 1/8] toys.h: Include strings.h.

Rob Landley rob at landley.net
Fri Apr 27 23:24:20 PDT 2012


On 04/27/2012 11:17 AM, Georgi Chorbadzhiyski wrote:
> Around 04/27/2012 04:23 AM, Rob Landley scribbled:
>> Georgi Chorbadzhiyski said:
>>>  This is needed for strcasecmp, strncasecmp, index and rindex.
>>
>> In what context is this needed?  I believe you, but it builds fine for
>> me on glibc and on uclibc. Where specifically does it _not_ build?
>>
>> Can you tell me how to reproduce the problem so I'll know whether or not
>> I've fixed it, and whether I accidentally reintroduce it in future?
> 
> musl libc without _GNU_SOURCE do not define strcasecmp, strncasecmp,
> index and rindex. According to:
> 
> http://pubs.opengroup.org/onlinepubs/009695399/functions/strcasecmp.html
> http://pubs.opengroup.org/onlinepubs/009695399/functions/strncasecmp.html
> http://pubs.opengroup.org/onlinepubs/009695399/functions/index.html
> http://pubs.opengroup.org/onlinepubs/009695399/functions/rindex.html
> 
> To get these functions #include <strings.h> is needed.
> 
> Since glibc and uclibc define the functions anyway we can rule that musl
> is too standards compliant in this case and ignore the strings.h include.
> I don't care in this case, since without -D_GNU_SOURCE with musl toybox
> can't be build anyway.

Ok.  I can add the header to humor musl, doesn't actually hurt anything.
I was just trying to figure out what it was for...

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1335594260.0


More information about the Toybox mailing list