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: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Wed, 1 Dec 2004 11:32:47 -0800
Reply-to: rt@xxxxxxxxxxx

<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.

>   - Changing the typedef for a #define

No way.

> I don't think I'm qualified to make that decision, so I'll let you
> figure out what to do.
>
>
> [*] They have to.  But then again, they could make an exception for a
> simple typedef.  It's just too much hassle for what it's worth.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa








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