Source
Filed from a downstream consumer (Straton-Labs-LLC/stratton-internal, vendoring WebDriverAgentLib.xcframework).
Tracking ID in our audit: ocr-prelim-06896.
Affected file
WebDriverAgentLib/RodmanRunnerLib/RRConfig.h (vendored header at native/runner/Frameworks/WebDriverAgentLib.xcframework/ios-arm64/RodmanRunnerLib.framework/Headers/RRConfig.h)
Defect
The file is wrapped in NS_ASSUME_NONNULL_BEGIN ... NS_ASSUME_NONNULL_END. Every pointer parameter in that region inherits nonnull. The relevant mutator:
+ (BOOL)setScreenshotOrientation:(NSString *)orientation error:(NSError **)error;
Under the NS_ASSUME_NONNULL_BEGIN region the error parameter is NSError * _Nonnull * _Nonnull, i.e. callers must pass a non-null pointer to an NSError * slot.
That is the opposite of the standard Cocoa "pass NULL if you don't care about the error" idiom. Apple's own convention (and every other Foundation API that uses NSError **) is the opposite: NSError * _Nullable * _Nullable.
Consumers that follow the standard idiom (i.e. [RRConfig setScreenshotOrientation:@"auto" error:NULL]) will get a nullability-completeness warning under -Wnullability-completeness, and downstream projects compiling with -Werror will fail to build.
Suggested fix
Mark the error parameter explicitly nullable at the parameter level:
+ (BOOL)setScreenshotOrientation:(NSString *)orientation
error:(NSError * _Nullable * _Nullable)error;
and audit every other mutator in this header for the same pattern (this is the only one that returns BOOL/NSError **, but worth checking valueFromArguments:forKey: too, which returns _Nullable already — good — but is inside the same NS_ASSUME_NONNULL_BEGIN block).
If the project standardizes on NS_SWIFT_CALL/NS_REFINED_FOR_SWIFT, also re-export these as Swift throws so the awkward NSError ** indirection is hidden from Swift callers.
Why this matters downstream
A vendored framework that violates the standard Cocoa nullability convention forces every downstream to either patch the header or disable -Wnullability-completeness (silently losing real diagnostics).
Source
Filed from a downstream consumer (
Straton-Labs-LLC/stratton-internal, vendoringWebDriverAgentLib.xcframework).Tracking ID in our audit:
ocr-prelim-06896.Affected file
WebDriverAgentLib/RodmanRunnerLib/RRConfig.h(vendored header atnative/runner/Frameworks/WebDriverAgentLib.xcframework/ios-arm64/RodmanRunnerLib.framework/Headers/RRConfig.h)Defect
The file is wrapped in
NS_ASSUME_NONNULL_BEGIN...NS_ASSUME_NONNULL_END. Every pointer parameter in that region inheritsnonnull. The relevant mutator:Under the
NS_ASSUME_NONNULL_BEGINregion theerrorparameter isNSError * _Nonnull * _Nonnull, i.e. callers must pass a non-null pointer to anNSError *slot.That is the opposite of the standard Cocoa "pass
NULLif you don't care about the error" idiom. Apple's own convention (and every other Foundation API that usesNSError **) is the opposite:NSError * _Nullable * _Nullable.Consumers that follow the standard idiom (i.e.
[RRConfig setScreenshotOrientation:@"auto" error:NULL]) will get anullability-completenesswarning under-Wnullability-completeness, and downstream projects compiling with-Werrorwill fail to build.Suggested fix
Mark the
errorparameter explicitlynullableat the parameter level:and audit every other mutator in this header for the same pattern (this is the only one that returns
BOOL/NSError **, but worth checkingvalueFromArguments:forKey:too, which returns_Nullablealready — good — but is inside the sameNS_ASSUME_NONNULL_BEGINblock).If the project standardizes on
NS_SWIFT_CALL/NS_REFINED_FOR_SWIFT, also re-export these as Swiftthrowsso the awkwardNSError **indirection is hidden from Swift callers.Why this matters downstream
A vendored framework that violates the standard Cocoa nullability convention forces every downstream to either patch the header or disable
-Wnullability-completeness(silently losing real diagnostics).