[sldev] Re: -Werror problem in trunk

Robin Cornelius robin.cornelius at gmail.com
Thu Aug 21 09:49:29 PDT 2008

On Thu, Aug 21, 2008 at 5:28 PM, Mana Janus <mana.janus at web.de> wrote:
> Absolutely, Jason, if you are using C++ only. "typedef struct { ... }
> Vertex" is the old C way of doing it.
> In C++ the simple "struct Vertex { ... }" has the exact same effect and
> should be preferred, when the header is never included from C.
> After all, you are not doing "typedef class { ... } Name", are you? ;-)

Now i'm really confused ;-) but would like to understand this fully.
Sorry to be stupid here..

Are you saying that simply saying struct Vertex { ... } is all that is needed ?

and this is the C++ equivalent of typedef struct { ... } Vertex ,
which is still valid but deprecated unless the header is to be used as
a general purpose header (eg C may use it)

and  typedef struct Vertex {...} is actually wrong but many compilers
accept it but gcc 4.3.1 now rejects it as invalid?



More information about the SLDev mailing list