I inherited a project that contained a lot of 320 code, and that code base threw several warnings and static analyzer errors at me that 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-all-checks
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-all-checks" to suppress warnings and clang warnings
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…