This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
BUG: sys/stat.h interferes with time.h
- From: Scott Pakin <scott at pakin dot org>
- To: newlib at sources dot redhat dot com
- Date: Fri, 18 Aug 2006 20:41:10 -0600
- Subject: BUG: sys/stat.h interferes with time.h
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).