discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: QNX - GNUstep and Objective C


From: bbceler
Subject: Re: Re: QNX - GNUstep and Objective C
Date: Fri, 8 Jan 2010 10:59:26 -0800 (PST)

I use as test program:
source.m
=========
#import <Foundation/Foundation.h>

int
main (void)
{
    NSLog (@"Executing");
    return 0;
}
=========
make CC=clang and use libobjc2

Error appears in when library function be called out:
  static void __objc_compute_ivar_offsets (Class class); from init.c
which be called out by:
static void
__objc_create_classes_tree (Module_t module)
{
...................
      objc_tree_insert_class (class);
      __objc_compute_ivar_offsets (class);
...................
}
 
I made in function __objc_compute_ivar_offsets change:
1. I added on beginning fprintf( ..........)
 static void
__objc_compute_ivar_offsets (Class class)
{
  int i = 0;
  /* If this class was compiled with support for late-bound ivars, the
   * instance_size field will contain 0 - {the size of the instance
variables
   * declared for just this class}.  The individual instance variable offset
   * fields will then be the offsets from the start of the class, and so
must
   * have the size of the parent class prepended. */
  fprintf(stderr, "class: %s ->instance_size %d \n", 
                       class->name, class->instance_size);
  if (class->instance_size <= 0)
    {
      super = class_superclass_of_class(class);
      if (Nil == super) { return; }
.............................
and I comment abort() on end of function:
.............................
      fprintf(stderr, "This probably means that you are subclassing a class
from a library, which has changed in a binary-incompatible way.\n");
//      abort();
    }
}

Result is following:
class: NXConstantString ->instance_size 12 
class: Object ->instance_size 4 
class: Protocol ->instance_size 20 
class: GSInet6ServerStream ->instance_size 160 
class: GSInetServerStream ->instance_size 160 
class: GSInet6OutputStream ->instance_size 160 
................................
class: NSException ->instance_size 16 
class: NSFileHandle ->instance_size 4 
class: GSAttrDictionaryEnumerator ->instance_size 12 
class: GSAttrDictionary ->instance_size 80 
Error: Instance variables in GSAttrDictionary overlap superclass NSObject
Offset of first instance variable, statbuf, is 8
Last instance variable in superclass, isa, ends at offset 4
This probably means that you are subclassing a class from a library, which
has changed in a binary-incompatible way.
class: NSDirectoryEnumerator ->instance_size 24 
class: NSFileManager ->instance_size 8 
..................................
class: GSRunLoopCtxt ->instance_size 76 
class: GSLocalServerStream ->instance_size 264 
Error: Instance variables in GSLocalServerStream overlap superclass
GSSocketServerStream
Offset of first instance variable, _serverAddr, is 158
Last instance variable in superclass, _address, ends at offset 160
This probably means that you are subclassing a class from a library, which
has changed in a binary-incompatible way.
class: NSOutputStream ->instance_size 4 
class: NSInputStream ->instance_size 4 
class: NSStream ->instance_size 4 
..................................
class: Protocol2 ->instance_size 36 
class: Protocol ->instance_size 20 
class: Object ->instance_size 4 
class: NXConstantString ->instance_size 12 
2010-01-08 12:39:27.031 LogTest[40984635] Executing

Function __objc_compute_ivar_offsets() be called out 379 times. For two
classes GSAttrDictionary and GSLocalServerStream appeared mistake.
It can from this was infer, that mistake however appears in different place
?

-- 
View this message in context: 
http://old.nabble.com/QNX---GNUstep-and-Objective-C-tp26047107p27080734.html
Sent from the GNUstep - General mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]