bugGNUstep - Bugs: bug #31237, Cocoa.h redefinition problems

Group
 
 

bug #31237: Cocoa.h redefinition problems

Submitter:  Riccardo Mottola <rmottola>
Submitted:  Sun 03 Oct 2010 09:41:53 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Mar 2011 04:42:54 PM UTC, comment #3: 

Closing this since Fred fixed it months ago and there has been no feedback.

Richard Frith-Macdonald <CaS>
Group Member
Wed 13 Oct 2010 08:26:32 PM UTC, comment #2: 

I just commited a patch that combines your suggestion with the old code. Could you please give this a try?

Fred Kiefer <FredKiefer>
Group Member
Sun 03 Oct 2010 10:37:10 PM UTC, comment #1: 

in Cocoa.h, instead of

 40 #if (!defined(__cplusplus) && !defined(__USE_ISOC99))
 41 typedef BOOL bool;
 42 #define false NO
 43 #define true  YES
 44 #endif

it should probably be

#if (!defined(__cplusplus) && !defined(__bool_true_false_are_defined))

(According to this: http://www.opengroup.org/onlinepubs/9699919799/basedefs/stdbool.h.html )

Eric Wasylishen <ericw>
Group Member
Sun 03 Oct 2010 09:41:53 PM UTC, original submission:  

When Cocoa.h is included on OpenBSD with gcc 2.95, the following error happens:

 Compiling file VEAppController.m ...
In file included from /usr/GNUstep/Local/Library/Headers/WebKit/WebPlugin.h:25,
                 from /usr/GNUstep/Local/Library/Headers/WebKit/WebKit.h:35,
                 from VEDocument.h:27,
                 from VEAppController.m:27:
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:42: warning: `false' redefined
/usr/include/stdbool.h:26: warning: this is the location of the previous definition
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:43: warning: `true' redefined
/usr/include/stdbool.h:27: warning: this is the location of the previous definition
In file included from /usr/GNUstep/Local/Library/Headers/WebKit/WebPlugin.h:25,
                 from /usr/GNUstep/Local/Library/Headers/WebKit/WebKit.h:35,
                 from VEDocument.h:27,
                 from VEAppController.m:27:
/usr/GNUstep/System/Library/Headers/Cocoa/Cocoa.h:41: conflicting types for `_Bool'
/usr/include/stdbool.h:23: previous declaration of `_Bool'


A similar error happens for other files that include it. I cannot reproduce this with FreeBSD/gcc 4.2

Furthermore, if Foundation and AppKit are included instead of Cocoa, the problem goes away.

Riccardo Mottola <rmottola>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by ericw (Posted a comment)
  • -email is unavailable- added by rmottola (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-05 CaS StatusReady For Test Fixed
        Open/ClosedIn Test Closed
    2010-10-13 FredKiefer StatusNone Ready For Test
        Assigned toNone FredKiefer
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code