From: Nicola Pero Date: Thu, 12 Sep 2002 17:28:47 +0000 (+0000) Subject: Added comments to the definition of IMP X-Git-Tag: releases/gcc-3.3.0~2883 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c341bf5b799022ea0ce144a314ff756657497c9;p=thirdparty%2Fgcc.git Added comments to the definition of IMP From-SVN: r57072 --- diff --git a/libobjc/objc/objc.h b/libobjc/objc/objc.h index 79b2519e5765..699542c493bc 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, ...);