E
Ethan
/* rtclock.c */
#include
<time.h>
int main
()
{
struct timespec
ts;
clock_gettime(CLOCK_REALTIME,
ts);
return
0;
}
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
it compiles with
$> gcc -c -g rtclock.c
but why doesn't this compile with
$> gcc -std=c99 -c -g rtclock.c
rtclock.c: In function ‘main’:
rtclock.c:5: error: storage size of ‘ts’ isn’t known
rtclock.c:6: warning: implicit declaration of function ‘clock_gettime’
rtclock.c:6: error: ‘CLOCK_REALTIME’ undeclared (first use in this
function)
rtclock.c:6: error: (Each undeclared identifier is reported only once
rtclock.c:6: error: for each function it appears in.)
#include
<time.h>
int main
()
{
struct timespec
ts;
clock_gettime(CLOCK_REALTIME,
ts);
return
0;
}
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
it compiles with
$> gcc -c -g rtclock.c
but why doesn't this compile with
$> gcc -std=c99 -c -g rtclock.c
rtclock.c: In function ‘main’:
rtclock.c:5: error: storage size of ‘ts’ isn’t known
rtclock.c:6: warning: implicit declaration of function ‘clock_gettime’
rtclock.c:6: error: ‘CLOCK_REALTIME’ undeclared (first use in this
function)
rtclock.c:6: error: (Each undeclared identifier is reported only once
rtclock.c:6: error: for each function it appears in.)