mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Header conformance/improvements (part 2)
Date: Sat, 24 Feb 2018 19:17:45 -0500	[thread overview]
Message-ID: <20180225001745.GM1436@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAFhhQJRPgJiC_bNLW0ra+-VLPra4gVzihsgd_dwxKbZZNqP=7Q@mail.gmail.com>

On Fri, Feb 23, 2018 at 02:48:10PM -0500, Daniel Sabogal wrote:
> On Fri, Feb 23, 2018 at 2:20 PM, Rich Felker <dalias@libc.org> wrote:
> > On Fri, Feb 23, 2018 at 01:32:49PM -0500, Daniel Sabogal wrote:
> >
> >> tar.h
> >> -----
> >> * TSVTX
> >> this constant is XSI-shaded
> >> glibc exposes it with _XOPEN_SOURCE
> >
> > tar.h is not governed by any modern standard. Not sure if there's any
> > reason to change it. I feel like making it depend on FTMs is wrong.
> 
> I see that tar.h is specified here:
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tar.h.html#tag_13_73

Uhg, how could I forget? OK, I'll fix this one.

> >> signal.h
> >> --------
> >> * int sigqueue(pid_t, int, /* const */ union sigval);
> >> harmless; it just doesn't reflect http://austingroupbugs.net/view.php?id=844
> >
> > 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.

> >> inttypes.h
> >> ----------
> >> * wchar_t
> >> this symbol is exposed to the ISO C namespace
> >> AFAICT, this symbol is CX-shaded, and according to n1570 7.8.2.4p1,
> >> it seems to be intended that <stddef.h> be included to expose wchar_t
> >
> > 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...
> >
> >> wchar.h
> >> -------
> >> * FILE
> >> this symbol is exposed to the ISO C namespace
> >> AFAICT, this symbol is CX-shaded, and according to n1570 7.29.2.1p1,
> >> it seems to be intended that <stdio.h> be included to expose FILE
> >
> > 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.

Rich


  reply	other threads:[~2018-02-25  0:17 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 [this message]
2018-02-25  8:07       ` Jens Gustedt
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=20180225001745.GM1436@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).