gnustep-dev
[Top][All Lists]
Advanced

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

another libobjc patch


From: Jeremy Bettis
Subject: another libobjc patch
Date: Tue, 29 Jul 2003 15:45:33 -0500

Here is a patch that for GCC < 3.3 (where I am told this problem is fixed).

The situation is that a Protocol is only initialized if it is used in a
class.  For example: (all in one file)

@Protocol A
@end

@Protocol B
@end

@interface C : Object <A>
@end

@implementation C
- (id) init
{
    [super init];
    // This one will work
    printf("Protocol A is %s\n", address@hidden(A) name]);
    // This one will crash
    printf("Protocol B is %s\n", address@hidden(B) name]);
    return self;
}
@end

My dirty rotten hack is that if the class_pointer is equal to 2
(PROTOCOL_VERSION), then I assume that the object is actually an
uninitialized Protocol object and I set the class_pointer to the Protocol
class.

If you can't accept this patch please let me know how I can make it
acceptable.  I really want this to go into the CVS dev-libs/libobjc.

-Jeremy

Attachment: patch20030729-2.txt
Description: Text document


reply via email to

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