给定 tmp.cpp:
#include <stdio.h>
#pragma report(disable, CCN8826)
int main(int argc, const char *argv[])
{
const char * hi = "hi\n";
printf(hi);
return 0;
}
尽管我使用#pragma report
它应该抑制警告,但我仍然得到:
bash-3.1$ xlC -qformat=all tmp.cpp
"tmp.cpp", line 8.12: 1540-2826 (W) The format string is not a string literal
and format arguments are not given.
如何摆脱该警告?
错误消息编号在此处,#pragma 报告说明在此处。我的编译器是 IBM XL C/C++ Advanced Edition for Blue Gene/P, V9.0