When invoking GSValue initWithBytes: ... objCType: @encode(void) the program
aborts. Isn't it okay to do this?


- (id) initWithBytes: (const void *)value
     objCType: (const char *)type
{
  int size;

  if (!value || !type)
    {
      NSLog(@"Tried to create NSValue with NULL value or NULL type");
      RELEASE(self);
      return nil;
    }

  self = [super init];

  // FIXME: objc_sizeof_type will abort when it finds an invalid type, when
  // we really want to just raise an exception
  size = objc_sizeof_type(type);
  if (size <= 0)
    {
      NSLog(@"Tried to create NSValue with invalid Objective-C type");
      RELEASE(self);
      return nil;
    }


Michael


_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to