我编译了以下c
程序gcc -ansi -pedantic -Wall test.c
:
#include <stdio.h>
#include <stdint.h>
#define BUFFER 21
int main(int argc, char* argv[]) {
uint64_t num = 0x1337C0DE;
char str[BUFFER]; /* Safely Holds UINT64_MAX */
if(argc > 1)
sscanf(argv[1],"%llu",&num);
sprintf(str,"%llu",num);
return 0;
}
我收到以下警告:
test.c:8:5: warning: ISO C90 does not support the ‘ll’ gnu_scanf length modifier
test.c:9:3: warning: ISO C90 does not support the ‘ll’ gnu_printf length modifier
C90
从/向字符串解析/打印 64 位整数的正确、符合标准的方法是什么
,不会产生这些警告?