bug-hurd
[Top][All Lists]
Advanced

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

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


From: Samuel Thibault
Subject: Re: C++ vs. glibc/Hurd/Mach headers
Date: Sun, 27 Nov 2016 17:14:26 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

Thomas Schwinge, on Sat 26 Nov 2016 19:53:34 +0100, wrote:
> 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

Don't use 0, but ESUCCESS.

>     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;

The HURD_MSGPORT_RPC seems missing casts between kern_error and error_t
indeed.

Samuel



reply via email to

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