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, 4 Dec 2016 23:24:34 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

Thomas Schwinge, on Mon 28 Nov 2016 12:05:44 +0100, wrote:
> > >     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;
> 
> This remains to be fixed; can you please commit your patch?

I guess I misread my test results, I didn't have any fix for this, but
I have now commited it.

> > The HURD_MSGPORT_RPC seems missing casts between kern_error and error_t
> > indeed.
> 
> Thanks for changing this code.  Though, the explicit casts are also not
> completely ideal, as they now hide other kinds of problems, for example:
> 
>     $ echo -e '#include <errno.h>\n#include <hurd.h>\n#include 
> <hurd/signal.h>\nvoid f(){ error_t err = 
> HURD_MSGPORT_RPC(&err,&err,&err,&err); }' | gcc -D_GNU_SOURCE -x c - -S -o 
> /dev/null -O2
> 
> ... in C compilation mode now no longer diagnoses "error: incompatible
> types when assigning [...]".  Oh well...  ;-/

Sure, we can't catch everything anyway.

Samuel



reply via email to

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