Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于一个序列
typedef int64_t I64; I64 i=5; printf("%"PRIi64",i);
cppcheck 给出以下警告:
警告:格式字符串(第 1 号)中的 %lld 需要“long long”,但参数类型为“signed int”。
makro PRIi64 由 lld 解析,这是正确的,但不接受 64 位整数类型作为 long long int。
我希望有办法解决这个问题,因为我们在项目中收到了很多这样的警告,并且再也看不到真正的错误了。
最新版本的 Cppcheck 未显示有关以下示例代码的警告:
void f(void) { typedef int64_t I64; I64 i=5; printf("%"PRIi64",i); }