aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorNicola Pero <nicola@gcc.gnu.org>2002-09-12 17:28:47 +0000
committerNicola Pero <nicola@gcc.gnu.org>2002-09-12 17:28:47 +0000
commit4c341bf5b799022ea0ce144a314ff756657497c9 (patch)
treedf4808c269f2775a780be15cff782b8e16b9b9e8 /libobjc
parentd0029ebd92a9eb85c1330dcb5bb13f4c3192030f (diff)
downloadgcc-4c341bf5b799022ea0ce144a314ff756657497c9.zip
gcc-4c341bf5b799022ea0ce144a314ff756657497c9.tar.gz
gcc-4c341bf5b799022ea0ce144a314ff756657497c9.tar.bz2
Added comments to the definition of IMP
From-SVN: r57072
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/objc/objc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libobjc/objc/objc.h b/libobjc/objc/objc.h
index 79b2519..699542c 100644
--- a/libobjc/objc/objc.h
+++ b/libobjc/objc/objc.h
@@ -73,7 +73,14 @@ typedef struct objc_object {
/*
** Definition of method type. When retrieving the implementation of a
-** method, this is type of the pointer returned
+** method, this is type of the pointer returned. The idea of the
+** definition of IMP is to represent a 'pointer to a general function
+** taking an id, a SEL, followed by other unspecified arguments'. You
+** must always cast an IMP to a pointer to a function taking the
+** appropriate, specific types for that function, before calling it -
+** to make sure the appropriate arguments are passed to it. The code
+** generated by the compiler to perform method calls automatically
+** does this cast inside method calls.
*/
typedef id (*IMP)(id, SEL, ...);