涉及到日期为2011年4月12日的N1570 ISO/IEC 9899:201x编程语言-C委员会草案,应该有一个函数timespec_get()
(见7.27.2.5)。
但是,MinGW gcc版本8.2.0在使用gcc -std=c11 snippet.c
编译以下代码片段时返回warning: implicit declaration of function 'timespec_get'
和error: 'TIME_UTC' undeclared
:
#include <time.h>
int main() {
struct timespec tstart;
timespec_get(&tstart, TIME_UTC);
return 0;
}
为什么呢?
timespec_get
和TIME_UTC
。您可以从https://winlibs.com/获取最新的MinGW-w64 UCRT版本。 - Brecht Sanders