[Toybox] _GNU_SOURCE definition problem
Georgi Chorbadzhiyski
gf at unixsol.org
Thu Mar 8 23:48:05 PST 2012
On 3/9/12 4:15 AM, Rob Landley wrote:
>> lib/lib.c: In function ‘find_in_path’:
>> lib/lib.c:393:3: warning: implicit declaration of function ‘index’ [-Wimplicit-function-declaration]
>> lib/lib.c:393:23: warning: incompatible implicit declaration of built-in function ‘index’ [enabled by default]
>
> That one I can replace since it's just a gratuitous rename, but the _BSD
> define should provide it.
>
>> lib/lib.c: In function ‘sig_to_num’:
>> lib/lib.c:877:3: warning: implicit declaration of function ‘strncasecmp’ [-Wimplicit-function-declaration]
>> lib/lib.c:881:3: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration]
>
> This is posix 2008, musl is broken.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/strncasecmp.html
Not really broken. We should #include <strings.h> /note the s/ to get strcasesmp()
and strncasecmp(). Using strings.h will also get us index() and rindex() with musl.
>> toys/chroot.c: In function ‘chroot_main’:
>> toys/chroot.c:25:2: warning: implicit declaration of function ‘chroot’ [-Wimplicit-function-declaration]
>
> This is a linux system call, musl is broken.
No idea why this is behind _GNU_SOURCE.
http://git.etalabs.net/cgi-bin/gitweb.cgi?p=musl;a=blob;f=include/unistd.h;h=7662e5188936536beaa4c60ed8362cd8931c5284;hb=HEAD#l146
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
1331279285.0
More information about the Toybox
mailing list