[Top][All Lists]

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

Re: C++ vs. glibc/Hurd/Mach headers

From: Brent W. Baccala
Subject: Re: C++ vs. glibc/Hurd/Mach headers
Date: Fri, 25 Nov 2016 17:00:50 -1000

On Fri, Nov 25, 2016 at 1:46 AM, Thomas Schwinge <thomas@schwinge.name> wrote:

Motivation for bringing this up again: GDB has recently switched from
using a C to a C++ compiler.  GDB, for obvious reasons, needs to access
low-level Hurd/Mach interfaces.

I've also had problems compiling hurd code using g++.

In addition to what Thomas has described, the ports library is unusable with C++ because struct port_info has a member named "class".

Also, the initializer syntax used in /usr/include/refcount.h is unusable with g++.  For example:

    209   const union _references op =
    210     { .references = { .weak = ~0U, .hard = 1} };

generates a compiler error:

sorry, unimplemented: non-trivial designated initializers not supported

To reproduce both problems, just create a file containing the line #include <hurd/ports.h> and try to compile it with g++.  It doesn't matter if you put it inside an extern "C" block, either.


reply via email to

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