libobjc: remove deprecated API (patch 4)

Message ID
State New
Headers show

Commit Message

Nicola Pero June 3, 2011, 5:02 p.m.
This patch removes -forward:: from Object.  I was planning to do this later, but the
previous patch (patch 3) removed -doesNotRecognize:, which was used in the default
implementation of -forward::, which generates some ugly warnings when compiling.  
Removing -forward:: removes the warnings.

Please note that at this stage the runtime may still invoke -forward:: if you have it 
implemented in your own class, and have not installed a custom forwarding routine.  
There are testcases in the GCC testsuite that test this.  This will all go away later, 
and will require removing the testcases, but at the same time I'd like to add new 
testcases for __objc_msg_forward and __objc_msg_forward2, which are the actual hooks 
used in practice by users of libobjc, but which currently are not really tested.

For now, this patch just removes [Object -forward::], which is deprecated, and makes 
libobjc compile again without warnings.

Committed to trunk.



Index: sendmsg.c
--- sendmsg.c   (revision 174593)
+++ sendmsg.c   (working copy)
@@ -936,9 +936,12 @@  __objc_block_forward (id rcv, SEL op, ...)
-/* This function is installed in the dispatch table for all methods
-   which are not implemented.  Thus, it is called when a selector is
-   not recognized.  */
+/* This function is called for methods which are not implemented,
+   unless a custom forwarding routine has been installed.  Please note
+   that most serious users of libobjc (eg, GNUstep base) do install
+   their own forwarding routines, and hence this is never actually
+   used.  But, if no custom forwarding routine is installed, this is
+   called when a selector is not recognized.  */
 static retval_t
 __objc_forward (id object, SEL sel, arglist_t args)
Index: ChangeLog
--- ChangeLog   (revision 174594)
+++ ChangeLog   (working copy)
@@ -1,5 +1,11 @@ 
 2011-06-03  Nicola Pero  <>
+       * Object.m ([-forward::]): Removed.
+       * objc/deprecated/Object.h ([-forward::]): Removed.
+       * sendmsg.c (__objc_forward): Updated comments.
+2011-06-03  Nicola Pero  <>
        * (OBJC_H): Removed objc-list.h.
        (OBJC_DEPRECATED_H): Removed objc-list.h.
        * objc/objc-list.h: File removed.
Index: Object.m
--- Object.m    (revision 174593)
+++ Object.m    (working copy)
@@ -248,12 +248,6 @@  see the files COPYING3 and COPYING.RUNTIME respect
             :class_get_class_method(self->isa, aSel)));
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame
-  (void) argFrame; /* UNUSED */
-  return (retval_t)[self doesNotRecognize: aSel];
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame
   return objc_msg_sendv(self, aSel, argFrame);
Index: objc/deprecated/Object.h
--- objc/deprecated/Object.h    (revision 174593)
+++ objc/deprecated/Object.h    (working copy)
@@ -49,7 +49,6 @@ 
 - (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
 /* Forwarding */
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
 /* Posing */