The clang docs state how to accomplish this.
- Assuiming -Werror is set, -Wno-error=X downgrades the error back to a warning. For example -Wno-error=#warnings would allow you to use the #waning pre-processor directive.
- -Werror=X, upgrades an error into a warning. For example -Werror=protocol will break the build if you forget to implement a required protocol method.
An easy way to find the name of an error is to check the build log (cmd-8) and expand on the warning.
If you want to selectively upgrade warnings, here are some flags to get you started.
-Werror=implicit-atomic-properties - properties are atomic by default, most of the time you want nonatimic. This forces you to explicitly say you want atomic.
-Werror=protocol - unimplemented required methods.
-Werror=incomplete-implementation - A method in the interface, but no implementation in the .m
-Werror=undeclared-selector - Using @selector on something XCode dons't know about, perhaps you renamed the method.
-Werror=arc-retain-cycles - Usually capturing self strongly in a block.
-Werror=mismatched-parameter-types - The method declaration doesn't match the implementation.
-Werror=shadow - Creating a local variable in a nested scope that overrides an existing variable with the same name.
-Werror=unknown-warning-option - Protects you from typos in these waring flags.
Plus you can to enable the two XCode assisted upgrades:
Here are some examples of the errors that would be enabled.