Recently, I've been working on cleaning up gcc's handling of method
prototypes, and how it selects one when sending a message. With a lot of
help from David Ayers, I now have a patched version that behaves the way
we think we want it to.
In addition to our artificial tests, I've tested by compiling GNUstep,
and in order to get some feedback on the new warnings, I've attached
logs of compiling -base and -gui with the new gcc. Since this may end up
affecting all objective-c code (including yours ;-), I'd appreciate
comments on:
* whether the new behavior (ie. actually code generated, not warnings)
is good. The only big difference from the current behavior is in the
case where the receiver is "typed" (ie. not 'id' or 'Class'), and a
method prototype could not be found in the type. Previous versions would
fall back to "no prototype", which means the return value was assumed to
be 'id' and the arguments passed as to a variadic function. The new
behavior is to search globally for a prototype before giving up, just as
for receivers of type 'id' or 'Class'.
* whether the new warnings are good. Some may be seen as a bit pedantic,
but I think they're acceptable (ie. sufficiently helpful to be worth the
trouble).
* whether the wording of the new warnings is good. In particular, it's
important that the longer warnings about what gcc will do when it finds
no/several prototypes are clear.
In addition, we should clear up the issues indicated by the warnings.
Some are just minor typos or inconsistencies, or may require a cast so
that gcc can know for sure which prototype applies, but some indicate
serious problems.