This was discovered by running into a broken dieharder: https://bugs.gentoo.org/show_bug.cgi?id=531268 Reproducible: Always Steps to Reproduce: emerge =app-crypt/dieharder-3.31.1 Actual Results: make[1]: Entering directory '/var/tmp/portage/app-crypt/dieharder-3.31.1/work/dieharder-3.31.1/libdieharder' /bin/sh ../libtool --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DVERSION=3.31.1 -DLITTLE_ENDIAN=1 -I ../include -I /usr/include -std=c99 -Wall -pedantic -O2 -pipe -c -o libdieharder_la-bits.lo `test -f 'bits.c' || echo './'`bits.c libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -DVERSION=3.31.1 -DLITTLE_ENDIAN=1 -I ../include -I /usr/include -std=c99 -Wall -pedantic -O2 -pipe -c bits.c -fPIC -DPIC -o .libs/libdieharder_la-bits.o In file included from ../include/dieharder/libdieharder.h:22:0, from bits.c:7: /usr/include/unistd.h:1043:20: error: unknown type name 'intptr_t' extern void *sbrk (intptr_t __delta) __THROW; ^ bits.c: In function 'fill_uint_buffer': bits.c:407:15: warning: variable 'bufbits' set but not used [-Wunused-but-set-variable] unsigned int bufbits,bdelta; ^ Makefile:570: recipe for target 'libdieharder_la-bits.lo' failed make[1]: *** [libdieharder_la-bits.lo] Error 1 make[1]: Leaving directory '/var/tmp/portage/app-crypt/dieharder-3.31.1/work/dieharder-3.31.1/libdieharder' Makefile:412: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 * ERROR: app-crypt/dieharder-3.31.1::gentoo failed (compile phase): * emake failed Expected Results: Successful build of dieharder.
better to create a test case detached from this dieharder. when is exactly (conditional) the intptr_t used? write a simple main.c which defines some macros, #include <unitstd.h> to reproduce.
I have narrowed it down to the following test case: # main.c #include <stdio.h> #define __USE_MISC 1 #include <unistd.h> int main() { return 0; } # compilation % gcc -std=c99 -o main main.c In file included from main.c:3:0: /usr/include/unistd.h:1043:20: error: unknown type name ‘intptr_t’ extern void *sbrk (intptr_t __delta) __THROW;
Compilation succeeds without -std=c99
(In reply to Michael Trinque from comment #2) your use case is invalid. applications must *never* define __USE_xxx directly.