bug-gnustep
[Top][All Lists]
Advanced

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

Problem with NSFont, NSSet combination


From: Wim Oudshoorn
Subject: Problem with NSFont, NSSet combination
Date: Wed, 28 Mar 2001 11:23:30 +0200

It is probably more a gcc bug, but as long as we do not
have a language standard it is hard to tell.

Problem
-------

The following program does not compile:

--
        #include <Foundation/NSSet.h>
        #include <AppKit/NSFont.h>

        int main (void)
        {
                NSSet *anSet = [NSSet set];
        
                return 1;
        }

--
Compiler output:
        bug.m: In function `main':
        bug.m:6: void value not ignored as it ought to be
        make[2]: *** [shared_obj/ix86/linux-gnu/gnu-gnu-gnu-xgps/bug.o]
                         Error 1
        make[1]: *** [bug.build] Error 2

--
I narrowed the problem down to the following simpler example:

        #include <Foundation/Foundation.h>

        @interface AClass
        + (id) aMethod;
        @end

        @interface BClass
        - (void) aMethod;
        @end

        int main (void)
        {
                AClass *anSet = [AClass aMethod];
        
                return 1;
        }


This gives the same kind of error.   NSSet and NSFont problem is caused
by the existence of two methods set:  + (id) set in NSSet and - (void) set in
NSFont.

The strange thing however is that:

If you replace
        #include <Foundation/Foundation.h>
by
        #include <objc/Object.h>

The problem does NOT occur. (The program will not link of course)

Some extra information:
        gcc version 2.91.66
        GNUstep objc 0.9.3
                base 0.9.3

But I do not think that that is important.


Wim Oudshoorn.



reply via email to

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