您的位置:首页 > 其它

处理第三方模块的数据

2012-05-31 19:35 148 查看
== === ===== ====

if you're just using clang, then you should use the pragma syntax for sources you maintain (assuming it is impossible to remove the warning by altering the program appropriately).

here
is the syntax:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmultichar"

char b = 'df'; // no warning.

#pragma clang diagnostic pop


if these are programs you cannot change and don't maintain, you should specify the warning(s) to disable for the file, rather than all. to disable all, you can add the per file argument
-w
.
sources change, and some warnings do (or do not) apply with different build settings. clang's messages can tell you what flag equates to the generated warning.

To use Xcode to alter a file's build flags:

select the target

select the build phase

locate the file to modify the arguments in the "Compile Sources" phase

double click its "Compiler Flags" cell to edit

===== clang 是个什么东东。。。。。。。。。。。

I had no interest in fixing since I will be removing that code from the project in the near future.

You can disable static analyzer warnings for a specific file by including the following compiler flag:
-Xanalyzer -analyzer-disable-checker


You can combine this with -w to disable warnings for that file as well. That has allowed me to push forward with new development while not having to be pestered with the 30 or so warnings generated by that code base.

Using the instructions from above: To use Xcode to alter a file's build flags:

select the target

select the build phase

locate the file to modify the arguments in the "Compile Sources" phase

double click its "Compiler Flags" cell to edit

add "-w -Xanalyzer -analyzer-disable-checker" to suppress warnings and clang warnings
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐