ltp testcase (signal_test_04.c) build failure after commit ae9e3f46520c35dd77f7f2a26f789a94276e6a8c

Rich Felker dalias at aerifal.cx
Tue Sep 10 05:29:18 UTC 2013


On Thu, Aug 29, 2013 at 03:02:22PM +0200, Filippo ARCIDIACONO wrote:
> Hi,
> Building ltp testsuite it fails when try to build signal_test_04.c with the
> the following error:
> 
> In file included from signal_test_04.c:85:0:
> /usr/include/sys/wait.h:116:22: error: unknown type name '__WAIT_STATUS'
> In file included from signal_test_04.c:85:0:
> /usr/include/sys/wait.h:169:23: error: unknown type name '__WAIT_STATUS'
> /usr/include/sys/wait.h:175:38: error: unknown type name '__WAIT_STATUS'
> signal_test_04.c: In function 'main':
> signal_test_04.c:203:2: warning: implicit declaration of function
> 'wait' [-W
> signal_test_04.c:205:2: warning: implicit declaration of function 'WIFSIGNAL
> signal_test_04.c:206:3: warning: implicit declaration of function 'WTERMSIG'
> make[4]: *** [signal_test_04] Error 1
> 
> I try to explain what happening.
> When stdlib.h is included by the test to get the needed stuff it
> isn't included
> because  it has been silently included, by bits/sched.h, in the
> inclusion chain of stdio.h.
> Follow the header included by the test:
> 
> #include <stdio.h>
> #include <string.h>
> #ifdef _LINUX_
> #define __USE_XOPEN
> #endif
> #include <unistd.h>
> #include <stdlib.h>
> #include <sys/signal.h>
> #include <sys/wait.h>
> #include <errno.h>

This code is utter nonsense. __USE_XOPEN is an _internal_ glibc/uClibc
macro defined by features.h. Any program defining this macro itself is
plain wrong. Moreover, if fixing it to use the correct feature test
macro (_XOPEN_SOURCE), all feature test macros must be defined
_before_ any system headers are included. You can't include some
system headers, then define some feature test macros, then include
more headers.

Rich


More information about the uClibc mailing list