All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zackw@panix.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Various pages: Remove unused <sys/types.h>
Date: Sun, 14 Mar 2021 17:40:21 -0400	[thread overview]
Message-ID: <CAKCAbMiJO8gq7LoDi-iTvmqvDpwUXXnTs8ABHXvin-psyo3+QQ@mail.gmail.com> (raw)
In-Reply-To: <20210314160134.127878-1-alx.manpages@gmail.com>

On Sun, Mar 14, 2021 at 12:04 PM Alejandro Colomar via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> The manual pages are already inconsistent in which headers need
> to be included.  Right now, not all of the types used by a
> function have their required header included in the SYNOPSIS.
>
> If we were to add the headers required by all of the types used by
> functions, the SYNOPSIS would grow too much.  Not only it would
> grow too much, but the information there would be less precise.
>
> Having system_data_types(7) document each type with all the
> information about required includes is much more precise, and the
> info is centralized so that it's much easier to maintain.
>
> So let's document only the include required for the function
> prototype, and also the ones required for the macros needed to
> call the function.

I endorse this change.  For glibc, if the header file containing the
function prototype doesn't also provide everything you need to call
the function, it's a bug (except for a few cases where the relevant
standards prevent us from doing this, e.g. a function that calls
vprintf will need the macros in <stdarg.h>, but the C standard
specifically forbids <stdio.h> to include <stdarg.h>).

> <sys/types.h> only defines types, not functions or constants, so
> it doesn't belong to man[23] (function) pages at all.
> I ignore if some old systems had headers that required you to
> include <sys/types.h> *before* them (incomplete headers),

Such systems did exist in the past, but they are too old to worry
about nowadays.  I don't think it's possible for them to be compliant
with POSIX.1-1995, and the examples I know of personally (SunOS 4, for
instance) were not even fully compliant with C89.

zw

  reply	other threads:[~2021-03-14 21:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 16:01 [PATCH] Various pages: Remove unused <sys/types.h> Alejandro Colomar
2021-03-14 21:40 ` Zack Weinberg [this message]
2021-03-14 22:00   ` Michael Kerrisk (man-pages)
2021-03-15 18:25   ` Joseph Myers
2021-03-19 20:35     ` Alejandro Colomar (man-pages)
2021-03-15  7:44 ` Michael Kerrisk (man-pages)

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=CAKCAbMiJO8gq7LoDi-iTvmqvDpwUXXnTs8ABHXvin-psyo3+QQ@mail.gmail.com \
    --to=zackw@panix.com \
    --cc=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.