Stage 8 of clang compiler warning patches. #30
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stage 8: CAUTION
I have scrapped my original patches that descretely fix build errors on FreeBSD (or rather libobjc2). SOPE is riddled with messy runtime compatability definitions, dating back a long time. I'm talking about 'sel_eq', 'sel_get_name', 'objc_malloc', 'objc_free' etc. There was lots of ugly, inconsistent and nonsensical #if's and #ifdefs for all the different brands and ages of Objective C runtimes.
So, I cleaned up all this stuff in the common.h header files, and used only the modern calls throughout the implementation code. But of course, I was worried about the compatability with the various platforms and older runtimes. So I installed RHEL 5.11 in VirtualBox and managed to build SOPE from my github fork. It worked like a charm!
So, the GNUstep Runtime (libobjc2) and the GCC Runtime (libobjc) >= 4.1.2 build successfully with all my changes up to Stage 8. But I have not tested on any Apple/NeXT Runtimes (Mac OS X), since I don't have access to OS X. According to David Chisnall, it should be OK to use the same modern calls that work in libobjc2.
If the support needs to go back further, and the modern calls are not OK. Then I can add back some much neater, consolidated compatability definitions. I suggest each common.h header file include a project wide header file called runtime_compat.h. Then the runtime specific substitutions could all go in one place.
There is potential for much more, similar, cleanup in SOPE.