Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc
Home

[Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: fbriere@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11281) [C++] forward enum declaration in common/fc_types.h
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Dec 2004 12:02:54 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=11281 >

Vasco Alexandre da Silva Costa wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=11281 >
> 
> On Wed, 1 Dec 2004, [UTF-8] Frédéric Brière wrote:
> 
> 
>>This is a forward declaration of an enum, and is actually invalid under
>>C89 and C99, as well as C++.  (gcc will trigger an error in pedantic
>>mode.)  C compilers tend to be lenient about this, but C++ compilers are
>>more stringent. [*]
>>
>>There are three possible solutions:
>>
>>  - Moving the enum before the typedef
>>
>>  - Moving the typedef after the enum
> 
> 
> Either are ok by me.

I think you can't move the typedef after the enum.  There's a reason the 
typedef is in fctypes.h.  But you can move the enum into fctypes.h as 
well.  I think pretty much any type can be moved into fctypes.h if 
needed.  But fctypes should not need to #include any other headers from 
common/.

-jason





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