我想返回 auint64_t
但结果似乎被截断:
在lib.c
:
uint64_t function()
{
uint64_t timestamp = 1422028920000;
return timestamp;
}
在main.c
:
uint64_t result = function();
printf("%llu = %llu\n", result, function());
结果:
394745024 = 394745024
在编译时,我收到一个警告:
warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'uint64_t' [-Wformat]
warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'int' [-Wformat]
为什么编译器认为我的函数的返回类型是 an int
?我们如何解释打印的结果与函数发送的值不同function()
?