|
From: | Bertrand Dekoninck |
Subject: | Re: Warning with clang, error with gcc : attached files |
Date: | Tue, 30 Apr 2019 22:45:21 +0200 |
User-agent: | GNUMail (Version 1.3.0) |
On 30/04/2019 15:34, Bertrand Dekoninck wrote:OK, thanks for your quick answer. I don't see any either, but I could try to modify NSButtonCell.h locally to have this method public. Maybe I need more help.Normally, the fix for this kind of thing is to declare a category on NSButtonCell that exposes the method that you want. It's somewhat fragile, so best practice would be to have a dynamic check in your +initialize that checks that the method does exist.Netherletheless, it doesn't explain why clang don't throw an error here. And I've got several warnings of this kind when compiling rik.theme. I suspect this is'nt the only private method that has be used is the rest of the code.
Thanks, I'll investigate this.
Clang doesn't give an error because it's well-defined behaviour: the method will be assumed to return id and will be called assuming all parameters are of type id, unless otherwise specified. That's almost certainly wrong, which is why it's a warning.In ARC mode, this is explicitly a failure (even if the calling convention is correct, the memory ownership semantics are unknown) and this is one of the many reasons why anyone using Objective-C in 2019 should be using ARC for almost everything.
If only I could... but Objc2 is still no an option on ppc linux and that's precisely why I want to port rik to objc1.
Bertrand
[Prev in Thread] | Current Thread | [Next in Thread] |