diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2011-02-28 14:48:23 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2011-02-28 14:48:23 +0000 |
commit | 68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81 (patch) | |
tree | 2206ef603597ed2c4ee93c47cebe6a18a1f3fcb0 /libobjc/objc | |
parent | 2f2935b6d5c7d9976710d40b79036bec4c7087aa (diff) | |
download | gcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.zip gcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.tar.gz gcc-68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81.tar.bz2 |
In libobjc/: 2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/:
2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
* selector.c (sel_getTypedSelector): Return NULL if there are
multiple selectors with conflicting types.
* objc/runtime.h (sel_getTypedSelector): Updated documentation.
In gcc/testsuite/:
2011-02-28 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/gnu-api-2-sel.m: Test that sel_getTypedSelector return
NULL in case of a selector with conflicting types.
* obj-c++.dg/gnu-api-2-sel.mm: Same change.
From-SVN: r170563
Diffstat (limited to 'libobjc/objc')
-rw-r--r-- | libobjc/objc/runtime.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h index 551c348..6e1f1ec 100644 --- a/libobjc/objc/runtime.h +++ b/libobjc/objc/runtime.h @@ -226,14 +226,16 @@ objc_EXPORT SEL * sel_copyTypedSelectorList (const char *name, unsigned int *numberOfReturnedSelectors); /* Return a selector with name 'name' and a non-zero type encoding, if - any such selector is registered with the runtime. If there is no - such selector, NULL is returned. Return NULL if 'name' is NULL. + there is a single selector with a type, and with that name, + registered with the runtime. If there is no such selector, or if + there are multiple selectors with the same name but conflicting + types, NULL is returned. Return NULL if 'name' is NULL. This is useful if you have the name of the selector, and would really like to get a selector for it that includes the type encoding. Unfortunately, if the program contains multiple selector - with the same name but different types, sel_getTypedSelector - returns a random one of them, which may not be the right one. + with the same name but different types, sel_getTypedSelector can + not possibly know which one you need, and so will return NULL. Compatibility Note: the Apple/NeXT runtime has untyped selectors, so it does not have this function, which is specific to the GNU |