当前位置: 技术问答>linux和unix
Unix编程,例子源码为何编译错误
来源: 互联网 发布时间:2016-05-01
本文导语: 代码如下,应该很小的程序,我下的源码,但是gcc通不过,为何啊? #include "defs.h" #include #include /*[time_test]*/ #define REPS 1000000 #define TV_SUBTRACT(t2, t1) (double)(t2).tv_sec + (t2).tv_usec / 1000000.0 - ((double)(t1).tv_sec +...
代码如下,应该很小的程序,我下的源码,但是gcc通不过,为何啊?
#include "defs.h"
#include
#include
/*[time_test]*/
#define REPS 1000000
#define TV_SUBTRACT(t2, t1)
(double)(t2).tv_sec + (t2).tv_usec / 1000000.0 -
((double)(t1).tv_sec + (t1).tv_usec / 1000000.0)
int main(void)
{
int i;
char msg[100];
clock_t c1, c2;
struct timeval tv1, tv2;
snprintf(msg, sizeof(msg), "%d getpids", REPS);
ec_neg1( c1 = clock() )
gettimeofday(&tv1, NULL);
timestart();
for (i = 0; i
#include "defs.h"
#include
#include
/*[time_test]*/
#define REPS 1000000
#define TV_SUBTRACT(t2, t1)
(double)(t2).tv_sec + (t2).tv_usec / 1000000.0 -
((double)(t1).tv_sec + (t1).tv_usec / 1000000.0)
int main(void)
{
int i;
char msg[100];
clock_t c1, c2;
struct timeval tv1, tv2;
snprintf(msg, sizeof(msg), "%d getpids", REPS);
ec_neg1( c1 = clock() )
gettimeofday(&tv1, NULL);
timestart();
for (i = 0; i