http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49301

           Summary: Forward declaration of classes broken
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: objc
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: j...@kuijpersvof.nl


In the current gcc from SVN is the meaning of @class broken.

@class is used to tell the compiler the class exists, but that its not (yet)
available. Eg: class B uses class A, but class A uses class B too, creating a
recursive import, and thus goes wrong.

Using @class now broke. This is the warning the compiler gives, for example:


OFConnectionFailedException.m: In function â-[OFConnectionFailedException
dealloc]â:
OFConnectionFailedException.m:68:2: warning: @interface of class âOFTCPSocketâ
not found [enabled by default]

It seems like @class is expecting the @interface to follow in the same file...

Please recover the function of @class as it is an important functionality.


Example.m:
[code]
#import <objc/objc.h>
#import <objc/Object.h>

@class myClass;

int main()
{
    myClass *obj = [myClass new];
}

@interface myClass : Object
@end

@implementation myClass
@end
[/code]


$ gcc -lobjc Example.m
Example.m: In function âmainâ:
Example.m:8:2: warning: @interface of class âmyClassâ not found [enabled by
default]

Reply via email to