Writing for Mac Cocoa in Objective-C, I have a subclass of NSApplication that overrides sendAction:to:from:. The override often ends up calling

[super sendAction: anAction to: aTarget from: sender]

and when aTarget is nil, UB Sanitizer says "Null pointer passed as argument 1, which is declared to never be null". Yet the declaration in the NSApplication header (and in my subclass) is

- (BOOL)sendAction:(SEL)action to:(nullable id)target from:(nullable id)sender;

so it should be fine for the target argument to be nil, assuming that's the one it means when it says "argument 1". I thought maybe the compiler wasn't sure about the type of "super", so I tried casting it to NSApplication*, but that's not allowed. Am I missing anything?
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to