|
Message-ID: <20180225090705.31a21fe6@inria.fr>
Date: Sun, 25 Feb 2018 09:07:05 +0100
From: Jens Gustedt <jens.gustedt@...ia.fr>
Cc: musl@...ts.openwall.com
Subject: Re: Header conformance/improvements (part 2)
Hello Rich,
On Sat, 24 Feb 2018 19:17:45 -0500 Rich Felker <dalias@...c.org> wrote:
> > > I don't think this is any actual diference; the const keyword is
> > > a nop there. Issue 844 is just about the standard gratuitously
> > > including a do-nothing keyword there.
> >
> > Right. Keeping the qualifier here is harmless.
>
> Oh, I read it backwards and thought we lacked the const. I'm in favor
> of removing redundant/meaningless stuff in declarations. BTW all
> instances of __restrict except one or two (pointer-to-__restrict) are
> also of this type; they're meaningless in the declaration and perhaps
> should be removed.
You are right concerning the validity of the interface, and I agree
that the const should be removed. It contains no valuable information
for the caller.
The restrict information is different. Restrict is a important
contract with the caller, and it is really a pitty that it cannot be
enforced. Nevertheless compilers can (and should) diagnose violations
of the restrict contract that it is able to deduce from the visible
code. So I think such information should not be removed from
interfaces.
> > > Ah. This is problematic because functions declared in inttypes.h
> > > require wchar_t to prototype. Of course a shadow name for the same
> > > type can be defined (like how va_list is handled) but it's ugly...
> > >
> [...]
> > >
> > > Similar issue. It could be fixed with a shadot typedef or explicit
> > > "struct _IO_FILE". The latter is ugly and something of a
> > > violation of the abstraction, I think..
> >
> > Indeed. I think ISO C should have exposed these data types.
>
> I agree. Maybe we should change it though. I'll think about it. I know
> there were tests (I think gcc fixincludes mess) flagging spurious
> exposure of va_list as a bug, and in principle someone might decide to
> do the same here, but maybe we should wait to make any change until
> if/when there's a problem.
I agree, all C library header specifications in the standard should
force all types of their interfaces exposed. I note that as a
modification request for C2x, but I would not at all be sure that such
a change would be consensual, and such a change would still be only in
years to come.
Thanks
Jens
--
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536 ::
:: :::::::::::::::::::::: gsm France : +33 651400183 ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.