Avoid harmless warning about using nil in wxMac wxNotebook code

At least with 10.12 SDK, NSTabViewItem initWithIdentifier: parameter
isn't annotated as being nullable, so passing "nil" to it triggers a
compiler warning.

This warning is apparently harmless and the header was fixed in 10.13
SDK, so just suppress it.
This commit is contained in:
Vadim Zeitlin
2018-07-28 02:26:45 +02:00
parent 3ec4e53aa1
commit 5d091e0962

View File

@@ -112,10 +112,18 @@
@implementation WXCTabViewImageItem : NSTabViewItem
- (id)init
{
// With 10.12 SDK initWithIdentifier: is declared as taking a non-nil value
// and while this was fixed in 10.13 by adding the missing "nullable",
// avoid the annoying warning with 10.12 by explicitly disabling it.
wxCLANG_WARNING_SUPPRESS(nonnull)
if (self = [super initWithIdentifier:nil])
{
m_image = nil;
}
wxCLANG_WARNING_RESTORE(nonnull)
return self;
}
- (void)dealloc