ARC C/C++ compiler
j at w1.fi
Mon Feb 21 15:33:56 EST 2011
On Mon, Feb 14, 2011 at 02:42:53PM +0100, Mikael Wikström wrote:
> If I where to create a patch for hostapd for this minimal C++
> compliant mode, would you then consider including it into the main
Yes, I would consider it. In theory, I would like to make hostapd and
wpa_supplicant as port as possible, but there is a limit to how much
extra complexity I would accept in the core code. In other words, I
would need to see the patch first.
> A: struct declaration must not be done inside other struct
> declarations as this would add a namespace to the inner struct.
I would assume the declaration itself would not be much of an issue, but
actual use of such struct would not go that well in C++.
> B: enum declaration must not be done inside struct declarations as
> this would add a namespace to the inner enum.
I'm not sure I really like some of the cases involved in A & B, but
well, I'm not sure whether there is any better alternative either. Is
there any way of getting "using namespace foo" working with struct
instead of explicit namespace declaration? I can think of some horrible
hacks like "#define bar foo::bar" to make a nested struct visible
without having to modify the code that is using it, but the end result
may not be any prettier..
> C: no typecasting is allowed from
> 1. int to enum
> 2. int to Boolean
> 3. minor syntactic changes often related to 1 and/or 2.
These can be somewhat ugly, too...
I think you missed one of my main annoyances in C++ compatibility: it
doesn't implicitly convert a void* to other pointer types. This is used
extensively in hostap.git.
Jouni Malinen PGP id EFC895FA
More information about the HostAP