aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-12 17:28:47 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-12 17:28:47 +0000
commitc8fb411605359c83861f022ab7fd477a324f442e (patch)
treedf4808c269f2775a780be15cff782b8e16b9b9e8 /libobjc
parenteca5e75969969ecea5a69ef86392243862a89e66 (diff)
Added comments to the definition of IMP
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57072 138bc75d-0d04-0410-961f-82ee72b054a4
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 79b2519e576..699542c493b 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, ...);