Xcode Compile Flag to Suppress Nullability Warnings not Working?

gcc suppress warning
xcode pointer is missing a nullability
nullability specifier '_nullable cannot be applied to non pointer type int
ns_assume_nonnull_begin
nullability specifier 'nullable' conflicts with existing specifier 'nonnull
inconsistent-missing-override
clang uninitialized variable warning
objective-c nullable

For a limited time I want to suppress these kind of warnings the compiler is showing me in Xcode 7.3.1:

<File>: Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

I have added this compiler flag to all classes under My Target/Build Phases/Compile Sources: -Wnullability-completeness

But it's not working - the warnings are still shown. How can I get rid of the warnings?

To disable those warnings, you want: -Wno-nullability-completeness. Note the no-; the flag you're using enables those warnings.

AWSMobileClient 2.12.0 causes hundreds of Swift compiler , Pointer is missing a nullability type specifier (_Nonnull, _Nullable, When compiling AWSMobileClient 2.12.0 with XCode 11 and Swift 5, hundreds of If applicable, add screenshots to help explain your problem. was a flag or setting that would truly suppress the nullability warnings in my build process. Select your target and show Build Phases. Then enter the name of the file in the search box, and you should see it listed in the Compile Sources phase. Double-click in the Compiler Flags column for that file and enter -w to turn off all warnings for that file.

Note that in Xcode 11 it is now -Wno-nonnull

It should be set in "Other Warning Flags" in the "Apple Clang - Custom Compiler Flags" section of your target.

You could also avoid these warnings and setting the above altogether by removing these flags Xcode automatically adds to new header files in Objective-C:

NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_END

Turn off nullability warnings in Xcode. These warning are added so , Xcode-nullability. In the Build Settings tab of a project's target, find the custom compile flag. key for the following entry: Other Warning Flags. Set that flag's value​  For a limited time I want to suppress these kind of warnings the compiler is showing me in Xcode 7.3.1: <File>: Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) I have added this compiler flag to all classes under My Target/Build Phases/Compile Sources: -Wnullability-completeness

In Xcode 11.3, these started appearing out of nowhere in my pure Swift project on the Github ci. That was because I am importing the AWS Objective-C SDK.

Confoundingly, this would only occur on the first build, probably creating the module map for the framework. Hence it was only a problem on ci because of the clean builds.

Fixed it by adding this to the Swift compiler options (search for OTHER_SWIFT_FLAGS in your build settings):

-Xcc -Wno-nullability-completeness

Pointer is missing a nullability type specifier, Xcode Compile Flag to Suppress Nullability Warnings not Working? For a limited time I want to suppress these kind of warnings the compiler is showing me in  Disabling single warnings categories of warnings in the podspecs is a moving target as the default warnings may change and do not represent the view of the author of the library. To enable the warnings to see if they meet the needs of the standards of the final user we should add the enable_warnings method in the pod file.

Settings for Xcode 11.5 when using project with mixed sources, ObjC and Swift:

WARNING_CFLAGS = $(inherited) -Wno-nullability-completeness
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -Wno-nullability-completeness

"Pointer is missing a nullability type spe |Apple Developer Forums, when compiling generated code in Xcode 8 directly in a swift-3 setup the compiler Compile with the "-Wno-nullability-completeness" flag if you just want the and aren't looking to broadly suppress all nullability completeness warnings Obviously a problem that should be sorted at j2objc side as there's nothing you can  Nullability and Objective-C UPDATE: This post was updated to use the new _Nullable syntax in Xcode 7. One of the great things about Swift is that it transparently interoperates with Objective-C code, both existing frameworks written in Objective-C and code in your app.

Nullability and Objective-C - Swift Blog, I'm pretty sure this is just a Swift compiler bug, but I'm surprised not to see many people running into it, which The constant doesn't have a nullability spec, however, so it throws a warning that I don't know how to prevent. One option is for clients to suppress these warnings via a pragma on the import. Suppress warnings about use of C++11 inheriting constructors when the base class inherited from has a C variadic constructor; the warning is on by default because the ellipsis is not inherited. -Wno-invalid-offsetof (C++ and Objective-C++ only) Suppress warnings from applying the offsetof macro to a non-POD type.

Xcode 10: No Longer Getting Nullability Warnings for ObjC header , Because the Swift compiler can't be sure whether a particular may have a NULL or nil value, while a _Nonnull one should not. Existing compiled code that uses your framework will continue to work, i.e. the ABI does not change. additional warnings for current uses of unsafe behavior at compile time  warning: ‘auto’ storage class specifier is not permitted in C++11, and will not be supported in future releases -Wauto-var-id ¶ This diagnostic is enabled by default.

Swift should allow for suppression of warnings, especially those that , some nullability annotations to an ObjC header file I would get warnings to annotate the rest. This no longer seems to work in Xcode 10. I went to Build settings  Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms. even if it would work the resulting ruby would be broken, drop this flag and let RVM install it with GNU gcc :

Comments
  • Did you clear out the existing warnings?
  • Cool, that worked on the .m files. Any idea how to disable it for the .h files?
  • I added this in XCode 9 (or 8) by adding it to Build Settings -> Apple LLVM 9.0 - Custom compiler flags -> Other Warning Flags. You can just search for Other Warning Flags
  • In Xcode 10, this was moved to Apple Clang - Custom Compiler Flags > Other Warning Flags
  • Sorry under which field to set this flag in Xcode 11?
  • @hyouuu I have updated the question to show where it should be set.
  • Thanks for the help!