Remove unused function declaration NSMakeCollectable#577
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to fix an ARC build failure caused by -Werror,-Wunused-parameter in NSMakeCollectable within the Foundation headers.
Changes:
- Removes the
static inline id NSMakeCollectable(const void *cf)definition fromHeaders/Foundation/NSZone.h.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #endif | ||
|
|
||
| static inline id NSMakeCollectable(const void *cf) { | ||
| #if __has_feature(objc_arc) | ||
| return nil; | ||
| #else | ||
| return (id)cf; // Unimplemented; garbage collection is deprecated. | ||
| #endif | ||
| } | ||
|
|
||
| #if defined(__cplusplus) | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Removing NSMakeCollectable entirely changes the public Foundation header surface (any downstream code that calls NSMakeCollectable will now fail to compile). The reported issue is specifically the unused parameter warning under ARC; a safer fix is to keep NSMakeCollectable and mark the parameter as intentionally unused in the ARC branch (e.g., via GS_UNUSED_ARG / attribute((unused)) on the parameter, or a (void)cf statement) so the API remains available while silencing -Wunused-parameter.
rfm
left a comment
There was a problem hiding this comment.
While the Copilot comment is correct about this being 'wrong', it doesn't understand the real world. I think this is actually a function declaration which is completely useless (and unused), so removing it is harmless. I understand that it was probably added in order to be formally compatible with OSX, but I'm not convinced that sort of 'compatibility' is valuable.
So, please add a ChangbeLog entry, and then we can merge.
|
@rfm thanks, ChangeLog added. Please squash commits when merging. |
Until gnustep/libs-base#577 is merged
|
@rfm is this PR blocked because of the changeling merge conflict? I was waiting on this as well. |
|
Sorry, I was unable to resolve the conflict from the github app on my phone; had to get to a desktop system to do it. |
|
No problem. Thank you. :) |
Without the change, we are getting in Gershwin AssistantFramework:
https://cirrus-ci.com/task/4869985861894144
Note
I am not sure whether this patch is correct for ARC and non-ARC environments; it does fix the compile error in Gershwin's ARC based code though.