I just started using newlib and ran across a problem. If sys/stat.h is
#include'd before time.h, then struct itimerval is left undeclared. Here's
a minimal example to reproduce the bug:
#include <sys/stat.h>
#include <time.h>
int main (void)
{
struct itimerval mytimer;
return 0;
}
% gcc -c -I/usr/include/newlib newlib-failure.c
newlib-failure.c: In function `main':
newlib-failure.c:6: error: storage size of `mytimer' isn't known
Swap the order of the two #include lines and all is well.
Regards,
-- Scott
P.S. I tried this using a native Linux/x86 build of newlib using the CVS
source checked out on 18Aug2006 (no configure options other than --prefix).