This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/49301] New: Forward declaration of classes broken
- From: "jos at kuijpersvof dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 6 Jun 2011 14:57:56 +0000
- Subject: [Bug objc/49301] New: Forward declaration of classes broken
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: jos@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]