[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ vs. glibc/Hurd/Mach headers
From: |
Thomas Schwinge |
Subject: |
Re: C++ vs. glibc/Hurd/Mach headers |
Date: |
Sat, 26 Nov 2016 19:53:34 +0100 |
User-agent: |
Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) |
Hi!
On Sat, 26 Nov 2016 13:36:22 +0100, Samuel Thibault <samuel.thibault@gnu.org>
wrote:
> Thomas Schwinge, on Fri 25 Nov 2016 12:46:33 +0100, wrote:
> > Additionally to the issues Samuel pointed
> > out in <https://www.sourceware.org/ml/libc-alpha/2007-08/msg00001.html>
> > (still unresolved),
>
> ?
>
> I can include hurd/signal.h fine from c++. The second part of my patch
> was applied
Right, hurd/signal.h's hurd_self_sigstate, _hurd_critical_section_lock,
and _hurd_critical_section_unlock have been fixed, but...
> and IIRC we made some changes to error_t.
... I don't see any such changes?
For GDB, the following is expected to work:
$ echo -e '#include <errno.h>\n#include <mach.h>\n#include
<hurd.h>\n#include <hurd/signal.h>\nvoid f(){ error_t err = 0; err =
thread_get_state(0,0,0,0); err = HURD_MSGPORT_RPC(0,0,0,0); }' | g++
-D_GNU_SOURCE -x c++ - -S -o /dev/null -O2
In file included from /usr/include/errno.h:35:0,
from <stdin>:1:
/usr/include/hurd.h: In function ‘int __hurd_fail(error_t)’:
/usr/include/hurd.h:60:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = EIEIO;
^
/usr/include/hurd.h:64:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = ENOMEM;
^
/usr/include/hurd.h:68:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = EINVAL;
^
<stdin>: In function ‘void f()’:
<stdin>:5:25: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
<stdin>:5:50: error: invalid conversion from ‘kern_return_t {aka int}’ to
‘error_t {aka __error_t_codes}’ [-fpermissive]
In file included from /usr/include/hurd/userlink.h:27:0,
from /usr/include/hurd/port.h:25,
from /usr/include/hurd.h:41,
from <stdin>:3:
<stdin>:5:67: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
<stdin>:5:67: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
<stdin>:5:67: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
When changing the GDB source code to use kern_return_t (or int) instead
of error_t, I still see hurd.h:__hurd_fail and
hurd/signal.h:HURD_MSGPORT_RPC choke on their own error_t usage:
$ echo -e '#include <errno.h>\n#include <mach.h>\n#include
<hurd.h>\n#include <hurd/signal.h>\nvoid f(){ kern_return_t err = 0; err =
thread_get_state(0,0,0,0); err = HURD_MSGPORT_RPC(0,0,0,0); }' | g++
-D_GNU_SOURCE -x c++ - -S -o /dev/null -O2
In file included from /usr/include/errno.h:35:0,
from <stdin>:1:
/usr/include/hurd.h: In function ‘int __hurd_fail(error_t)’:
/usr/include/hurd.h:60:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = EIEIO;
^
/usr/include/hurd.h:64:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = ENOMEM;
^
/usr/include/hurd.h:68:13: error: invalid conversion from ‘int’ to ‘error_t
{aka __error_t_codes}’ [-fpermissive]
err = EINVAL;
^
In file included from /usr/include/hurd/userlink.h:27:0,
from /usr/include/hurd/port.h:25,
from /usr/include/hurd.h:41,
from <stdin>:3:
<stdin>: In function ‘void f()’:
<stdin>:5:73: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
<stdin>:5:73: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
<stdin>:5:73: error: invalid conversion from ‘int’ to ‘error_t {aka
__error_t_codes}’ [-fpermissive]
Grüße
Thomas