qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel]


From: Jamie Lokier
Subject: Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense)
Date: Wed, 26 Aug 2009 22:00:16 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

malc wrote:
> On Wed, 26 Aug 2009, Jamie Lokier wrote:
> > malc wrote:
> > > > > (1) structs pointing to each other, like this:
> > > > > 
> > > > > typedef struct A A;
> > > > > typedef struct B B;
> > > > 
> > > > You can use "typedef struct _A A" to be C++ compatible, but it fails
> > > > to be shorter so I wouldn't recommend it ;-)
> > > 
> > > This is neither C nor C++ compatible, in fact it breaks both.
> > 
> > You'll have to explain that statement.
> 
> ISO/IEC 9899:1999 7.1.3#1
> and 17.4.3.1.2 of n2315 (Draft of c++0x)
> 
> mandate that those names are reserved.

The _A is just an example; just substitute an identifier you're happy
with.  Use lower case, or put the underscore at the end, or something else.

It's actively unhelpful to say "that is not C/C++ compatible" without
explaining that it's for an tangential reason which is easily avoided.

-- Jamie




reply via email to

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