Index: Headers/Foundation/NSMethodSignature.h
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Headers/Foundation/NSMethodSignature.h,v
retrieving revision 1.4
diff -u -r1.4 NSMethodSignature.h
--- Headers/Foundation/NSMethodSignature.h	2 Jul 2004 08:04:54 -0000	1.4
+++ Headers/Foundation/NSMethodSignature.h	30 Jul 2004 12:40:13 -0000
@@ -81,6 +81,7 @@
 #else
   NSArgumentInfo	*_info;
 #endif
+  const char		*_internalMethodTypes;
 }
 
 /**
Index: Source/GSFFCallInvocation.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/GSFFCallInvocation.m,v
retrieving revision 1.40
diff -u -r1.40 GSFFCallInvocation.m
--- Source/GSFFCallInvocation.m	2 Jul 2004 08:04:54 -0000	1.40
+++ Source/GSFFCallInvocation.m	30 Jul 2004 12:40:13 -0000
@@ -383,6 +383,7 @@
 
   if (!sel_type)
     {
+      NSWarnFLog(@"Provided untyped selector - assuming 'id'.");
       sel_type = "@";	// Default to id return type
     }
 
@@ -774,6 +775,7 @@
   int			i;
   int			num_args;
   void			*retval;
+  const char            *selectorName;
   vacallReturnTypeInfo	*typeinfo;
   NSArgumentInfo	*info;
   GSFFCallInvocation	*invocation;
@@ -795,6 +797,24 @@
   obj      = va_arg_ptr(args, id);
   selector = va_arg_ptr(args, SEL);
 
+  /* Fetch the selector from the runtime 
+     to get the portable type information later.  */
+  selectorName = sel_get_name(selector);
+  selector = sel_get_uid(selectorName);
+
+  if (!selector)
+    {
+      /* The selector is not registered with the runtime.  It seems 
+	 safe to assume that the receiver does not respond to it which
+	 would happen if we created a selector with the 'correct' types 
+	 and registered it manually.  So let us raise the corresponding
+	 exception.  */
+      [NSException raise: NSGenericException
+		   format: @"%s does not recognize %s",
+		   GSClassNameFromObject(obj), 
+		   selectorName ? selectorName : "(null)"];
+    }
+
   fwdInvMethod = gs_method_for_receiver_and_selector
     (obj, @selector (forwardInvocation:));
   
Index: Source/GSFFIInvocation.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/GSFFIInvocation.m,v
retrieving revision 1.26
diff -u -r1.26 GSFFIInvocation.m
--- Source/GSFFIInvocation.m	2 Jul 2004 08:04:54 -0000	1.26
+++ Source/GSFFIInvocation.m	30 Jul 2004 12:40:13 -0000
@@ -406,6 +406,7 @@
 {
   id			obj;
   SEL			selector;
+  const char            *selectorName;
   GSFFIInvocation	*invocation;
   NSMethodSignature	*sig;
   GSMethod              fwdInvMethod;
@@ -413,6 +414,23 @@
   obj      = *(id *)args[0];
   selector = *(SEL *)args[1];
 
+  /* Fetch the selector from the runtime 
+     to get the portable type information later.  */
+  selectorName = sel_get_name(selector);
+  selector = sel_get_uid(selectorName);
+
+  if (!selector)
+    {
+      /* The selector is not registered with the runtime.  It seems 
+	 safe to assume that the receiver does not respond to it which
+	 would happen if we created a selector with the 'correct' types 
+	 and registered it manually.  So let us raise the corresponding
+	 exception.  */
+      [NSException raise: NSGenericException
+		   format: @"%s does not recognize %s",
+		   GSClassNameFromObject(obj), 
+		   selectorName ? selectorName : "(null)"];
+    }
   fwdInvMethod = gs_method_for_receiver_and_selector
     (obj, @selector (forwardInvocation:));
   
Index: Source/NSMethodSignature.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/NSMethodSignature.m,v
retrieving revision 1.33
diff -u -r1.33 NSMethodSignature.m
--- Source/NSMethodSignature.m	2 Jul 2004 08:04:54 -0000	1.33
+++ Source/NSMethodSignature.m	30 Jul 2004 12:40:13 -0000
@@ -28,7 +28,8 @@
 
 #include "config.h"
 #include "GNUstepBase/preface.h"
-#include <mframe.h>
+#include "mframe.h"
+#include <string.h>
 
 #include "Foundation/NSMethodSignature.h"
 #include "Foundation/NSException.h"
@@ -37,6 +38,15 @@
 
 @implementation NSMethodSignature
 
+/**
+ * Returns a method signature with the corresponding ObjC types.  This
+ * type string must correspond to a type string recognized by the
+ * runtime which is a platform independent representation.  Internally
+ * this is transformed to a platform specific representation used 
+ * to generate the NSArgumentInfo structures.  You should never need 
+ * to access this internal representation and it should not be passed
+ * to this method.
+ */
 + (NSMethodSignature*) signatureWithObjCTypes: (const char*)t
 {
   NSMethodSignature *newMs;
@@ -46,8 +56,10 @@
       return nil;
     }
   newMs = AUTORELEASE([NSMethodSignature alloc]);
-  newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
-    &newMs->_numArgs, 0); 
+  newMs->_methodTypes = NSZoneMalloc(NSDefaultMallocZone(), strlen(t) + 1);
+  strcpy ((char *)newMs->_methodTypes, t);
+  newMs->_internalMethodTypes 
+    = mframe_build_signature(t, &newMs->_argFrameLength, &newMs->_numArgs, 0); 
 
   return newMs;
 }
@@ -121,6 +133,8 @@
 {
   if (_methodTypes)
     NSZoneFree(NSDefaultMallocZone(), (void*)_methodTypes);
+  if (_internalMethodTypes)
+    NSZoneFree(NSDefaultMallocZone(), (void*)_internalMethodTypes);
   if (_info)
     NSZoneFree(NSDefaultMallocZone(), (void*)_info);
   [super dealloc];
@@ -168,7 +182,7 @@
 {
   if (_info == 0)
     {
-      const char	*types = _methodTypes;
+      const char	*types = _internalMethodTypes;
       unsigned int	i;
 
       _info = NSZoneMalloc(NSDefaultMallocZone(),
