public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 3/5] manual: Add new header and standards annotations.
Date: Tue, 06 Dec 2016 19:23:00 -0000	[thread overview]
Message-ID: <fee12ed2-4363-6e4d-569e-5879be19f0d7@panix.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1612061601580.16077@digraph.polyomino.org.uk>

On 12/06/2016 11:23 AM, Joseph Myers wrote:
> On Tue, 6 Dec 2016, Zack Weinberg wrote:
> 
>> On 12/06/2016 05:55 AM, Rical Jasan wrote:
>>>       This commit completes header and standard annotations for all
>>>       @def*-commands and @vtable @items.
>>
>> A high-level observation: I don't think MISC should appear in these
>> annotations.  MISC is an artifact of <features.h> having collapsed
>> _BSD_SOURCE and _SVID_SOURCE together, IIUC.  The manual should
> 
> __USE_MISC long predates that.  The old comment before that consolidation 
> was "Define things common to BSD and System V Unix." (now "Define things 
> from 4.3BSD or System V Unix.", reflecting the change from "BSD intersect 
> SysV" to "BSD union SysV").
> 
> But actually I expect plenty of __USE_MISC declarations came from other 
> sources, including GNU-invented things that happen to be declared by 
> default (in headers that aren't themselves GNU-invented) rather than just 
> with _GNU_SOURCE.

Yeah, I've noticed cases like that myself.

So the rationale I gave was wrong, but I think the point - MISC is not a
useful thing to say in the manual - is only underlined by your
observations.  Yes?

>> Wasn't `long double` added in C99?  If so, all of the LDBL_* constants
>> are properly marked C99, not ISO.  (GCC's <float.h> defines them
>> unconditionally, but it supports `long double` as an extension in C90
>> mode.)
> 
> The FLT_* and LDBL_* constants are C90.  The float and long double 
> functions in math.h (and strtof and strtold) were introduced in C99.

Oh, OK, never mind then.

>>> +@comment stdio.h unistd.h fcntl.h
>>> +@comment C90, POSIX.1, XOPEN || POSIX.1-2008
>>>  @item SEEK_SET
>>
>> This is going to be really confusing.  I suspect it means "C90 puts
>> this macro in stdio.h, POSIX.1 additionally in unistd.h, and XOPEN in
>> fcntl.h" but I do hope we find a less ambiguous way to express that.
> 
> I hope the syntax gets replaced by macros that take both header and 
> standards as arguments, so they are always clearly paired.

Concur.

>>>  @vtable @code
>>> +@comment sys/mman.h
>>> +@comment BSD
>>>  @item MAP_PRIVATE
>>
>> mmap() itself was invented in SVR4, and the MAP_SHARED, MAP_PRIVATE,
>> MAP_FIXED constants were there from the beginning.
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
>> says "First released in Issue 4, Version 2" under CHANGE HISTORY.
>> I'm not sure exactly what annotations that corresponds to, but BSD is
>> definitely not right.
> 
> POSIX.1-1993 (otherwise known as POSIX.1b; available as a 40 MB PDF from 
> IEEE Xplore if you have a site license for that) adds sys/mman.h with 
> contents MAP_FAILED MAP_FIXED MAP_PRIVATE MAP_SHARED MCL_CURRENT 
> MCL_FUTURE MS_ASYNC MS_INVALIDATE MS_SYNC PROT_EXEC PROT_NONE PROT_READ 
> PROT_WRITE mlock mlockall mmap mprotect msync munlock munlockall munmap 
> shm_open shm_unlink.  XPG4.2 has a subset of that, which indicates 
> documenting some interfaces as POSIX.1-1993 and some as POSIX.1-1993 || 
> XPG4.2 (see bug 17663 for the headers failing to reflect that not all are 
> in XPG4.2, with the conform/ data having a matching bug).

So, how useful do you think the older POSIX/XPG/whatever conformance
modes actually are nowadays?  Could we conceivably get away with pruning
the list down to

 * C90 and nothing more
 * C99 and nothing more
 * C11 and nothing more

 * Cxx + POSIX.1-2001
 * Cxx + POSIX.1-2001 + XSI
 * Cxx + POSIX.1-2008
 * Cxx + POSIX.1-2008 + XSI

 * _DEFAULT_SOURCE
 * _GNU_SOURCE

plus the semi-orthogonal LFS and ATFILE toggles?

(I think POSIX.1-2001 is a good cutoff point because it's the first
unified POSIX/XPG standard and basically ubiquitous in my experience,
because there are still widely-used systems that haven't adopted all the
new stuff in -2008 (e.g. OSX.latest still doesn't have the _l
functions), and because -2008 removed a number of functions that are
still heavily used, e.g. gettimeofday, setcontext.)

(This is *largely* an independent issue from what should be in the
manual - I personally value detailed provenance information in the
manual, but verifying the history back into the early nineties gets
difficult, can involve spending money, and it's unclear to me how useful
it is to people who aren't history nerds.)

>> We need an annotation for "defined by the base ABI for the CPU."
>> I know there are similar functions for ARM (__aeabi_*) and IA64, and
>> probably others - that we only document the PowerPC ones is just a
> 
> The __aeabi_* functions don't have header declarations, just an ABI.  
> (There are ARM extension APIs with headers - defined in ACLE - but those 
> are generally pure header / compiler intrinsic APIs with no corresponding 
> library functions.)

Does that mean they shouldn't be documented, in your opinion? / Does
that mean we don't need the "defined by the base ABI for the CPU"
annotation that I suggested, in your opinion?

>>>  @comment Extra blank lines make it look better.
>>>  @vtable @code
>>> +@comment sys/wait.h
>>> +@comment MISC
>>>  @item WAIT_ANY
>> ...
>>> +@comment sys/wait.h
>>> +@comment MISC
>>>  @item WAIT_MYPGRP
>>
>> These constants do not appear in the FreeBSD manpage for waitpid, so
>> they are probably SVID.
> 
> SVID (fourth edition) is available from 
> <http://www.sco.com/developers/devspecs/>.  I don't see them there.  They 
> were __USE_BSD before commit 498afc54dfee41d33ba519f496e96480badace8e 
> unified things in the headers.

Hmm.  Spelunking around in http://minnie.tuhs.org/cgi-bin/utree.pl, the
oldest thing I can find that is recognizably <sys/wait.h> is from
4.3BSD-Reno,
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/sys/sys/wait.h,
and it does have the WAIT_ANY, WAIT_MYPGRP constants.  (4.2BSD has
http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/h/wait.h
which is related but clearly not the same file, and does not have those
macros.)  That site doesn't have the System V lineage, but I can't
really see those macros _not_ getting standardized if they were from
that lineage, so that's good enough for me to agree they were from BSD.

>> ("This function is obsolete" would be another good thing to have a
>> machine-parseable annotation for.)
> 
> It was certainly noted when we did the unification that we should consider 
> properly obsoleting some of the __USE_MISC functions (making them into 
> compat symbols so not included for new architectures or available for new 
> links, with or without a period of being declared as deprecated in the 
> headers first).  Much the same no doubt applies to non-function interfaces 
> as well.

I'm for such an obsoletions pass, but it's probably 2.26 material at
this point, and let's not tie it up with the manual work.

zw

  reply	other threads:[~2016-12-06 19:23 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 10:55 [PATCH v2 0/5] Header & Standards Cleanup Rical Jasan
2016-12-06 10:55 ` [PATCH v2 4/5] manual: Enforce header and standard requirements Rical Jasan
2016-12-06 10:55 ` [PATCH v2 2/5] manual: Convert @tables of variables to @vtables Rical Jasan
2016-12-06 13:50   ` Zack Weinberg
2016-12-06 15:46   ` Joseph Myers
2016-12-07 15:18   ` Nix
2016-12-08  1:38     ` Rical Jasan
2016-12-21 10:08       ` Rical Jasan
2016-12-21 12:42         ` Joseph Myers
2016-12-06 10:55 ` [PATCH v2 1/5] manual: Refactor header and standards annotations Rical Jasan
2016-12-06 13:49   ` Zack Weinberg
2016-12-06 15:33   ` Joseph Myers
2016-12-19 10:37     ` Rical Jasan
2016-12-19 13:48       ` Joseph Myers
2017-02-07  6:46   ` Rical Jasan
2016-12-06 10:56 ` [PATCH v2 3/5] manual: Add new " Rical Jasan
2016-12-06 13:23   ` Zack Weinberg
2016-12-06 14:27     ` Andreas Schwab
2016-12-06 16:24     ` Joseph Myers
2016-12-06 19:23       ` Zack Weinberg [this message]
2016-12-06 21:42         ` Joseph Myers
2016-12-07 16:32   ` Joseph Myers
2016-12-08  2:56     ` Rical Jasan
2016-12-08 14:02       ` Joseph Myers
2016-12-12  9:01         ` Rical Jasan
2016-12-14 18:18           ` Joseph Myers
2016-12-14 23:30             ` Rical Jasan
2016-12-15  9:58               ` Rical Jasan
2016-12-15 13:01                 ` Joseph Myers
2017-02-07  5:13                   ` Rical Jasan
2017-02-07 16:41                     ` Joseph Myers
2017-02-08  8:50                       ` Rical Jasan
2017-02-08 13:52                         ` Joseph Myers
2017-02-12  6:01                           ` Rical Jasan
2017-04-04  3:58                             ` Rical Jasan
2017-04-04 11:26                               ` Joseph Myers
2017-04-05  3:08                                 ` Rical Jasan
2017-06-16 13:40                                   ` Zack Weinberg
2017-06-16  8:28     ` Rical Jasan
2016-12-06 11:42 ` [PATCH v2 5/5] manual: Clean up miscellaneous standards Rical Jasan
2017-05-16  9:55 ` [PATCH v3 0/7] manual: Header & Standards Cleanup Rical Jasan
2017-05-16  9:55   ` [PATCH v3 2/7] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-16  9:55   ` [PATCH v3 1/7] manual: Provide one-off standards conversion script Rical Jasan
2017-05-16  9:55   ` [PATCH v3 3/7] manual: Fix up invalid header and standards syntax Rical Jasan
2017-05-16 11:51     ` Joseph Myers
2017-05-17  4:49       ` Rical Jasan
2017-05-17 10:03         ` Joseph Myers
2017-05-18  8:10       ` Rical Jasan
2017-05-16 10:27   ` [PATCH v3 7/7] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-16 10:28   ` [PATCH v3 5/7] manual: Convert @tables of annotated @items to @vtables Rical Jasan
2017-05-16 11:53     ` Joseph Myers
2017-05-18  8:11       ` Rical Jasan
2017-05-16 10:28   ` [PATCH v3 6/7] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-16 10:29   ` [PATCH v3 4/7] manual: Refactor errno @comments Rical Jasan
2017-05-16 11:06     ` Joseph Myers
2017-05-17  4:44       ` Rical Jasan
2017-05-17 13:21         ` Zack Weinberg
2017-05-17 13:31           ` Zack Weinberg
2017-05-18  9:42           ` Rical Jasan
2017-05-18 12:32             ` Zack Weinberg
2017-05-19  9:46               ` Rical Jasan
2017-05-19 20:50                 ` Zack Weinberg
2017-05-19  6:20         ` Rical Jasan
2017-05-18  9:58       ` Rical Jasan
2017-05-19  9:33   ` [PATCH v4 0/5] manual: Header & Standards Cleanup Rical Jasan
2017-05-19  9:33     ` [PATCH v4 2/5] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-19 21:02       ` Zack Weinberg
2017-05-20  6:05         ` Rical Jasan
2017-05-19  9:34     ` [PATCH v4 3/5] manual: Convert errno @comments to new @errno macro Rical Jasan
2017-05-19 21:03       ` Zack Weinberg
2017-05-20  6:05         ` Rical Jasan
2017-05-19  9:34     ` [PATCH v4 1/5] manual: Provide one-off standards conversion script Rical Jasan
2017-05-19  9:34     ` [PATCH v4 5/5] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-19  9:36     ` [PATCH v4 4/5] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-19 21:05     ` [PATCH v4 0/5] manual: Header & Standards Cleanup Zack Weinberg
2017-05-22  9:03       ` Rical Jasan
2017-05-24 13:12         ` Rical Jasan
2017-05-24 13:29           ` Zack Weinberg
2017-05-26  5:01     ` [PATCH v5 0/3] " Rical Jasan
2017-05-26  5:01       ` [PATCH v5 1/3] manual: Create empty placeholder macros for @standards Rical Jasan
2017-05-26  5:01       ` [PATCH v5 2/3] manual: Convert header and standards @comments to @standards Rical Jasan
2017-05-26  5:01       ` [PATCH v5 3/3] manual: Replace summary.awk with summary.pl Rical Jasan
2017-05-26  5:01       ` [PATCH v5 0/3] manual: Header & Standards Cleanup [conversion script] Rical Jasan
2017-05-31  9:23       ` [PATCH v5 0/3] manual: Header & Standards Cleanup Rical Jasan
2017-06-08 11:46         ` [PING] " Rical Jasan
2017-06-08 13:41           ` Zack Weinberg
2017-06-09  2:31             ` Rical Jasan
2017-06-15  8:47               ` Rical Jasan
2017-06-15  8:32           ` Rical Jasan
2017-06-15 18:01             ` Joseph Myers
2017-06-16  4:38               ` Rical Jasan

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=fee12ed2-4363-6e4d-569e-5879be19f0d7@panix.com \
    --to=zackw@panix.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).