mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <jens.gustedt@inria.fr>
Cc: musl@lists.openwall.com
Subject: Re: Header conformance/improvements (part 2)
Date: Sun, 25 Feb 2018 09:07:05 +0100	[thread overview]
Message-ID: <20180225090705.31a21fe6@inria.fr> (raw)
In-Reply-To: <20180225001745.GM1436@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 2612 bytes --]

Hello Rich,

On Sat, 24 Feb 2018 19:17:45 -0500 Rich Felker <dalias@libc.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 ::

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2018-02-25  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 18:32 Daniel Sabogal
2018-02-23 19:20 ` Rich Felker
2018-02-23 19:48   ` Daniel Sabogal
2018-02-25  0:17     ` Rich Felker
2018-02-25  8:07       ` Jens Gustedt [this message]
2018-03-10 23:14   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180225090705.31a21fe6@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).