public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Zack Weinberg <zackw@panix.com>
Cc: Alejandro Colomar <alx.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 23:00:18 +0100	[thread overview]
Message-ID: <CAKgNAkj7NjNMTKct3FGOZBLfZESLDo=1Le-da41LVa-PeQ9w0Q@mail.gmail.com> (raw)
In-Reply-To: <CAKCAbMiJO8gq7LoDi-iTvmqvDpwUXXnTs8ABHXvin-psyo3+QQ@mail.gmail.com>

Hello Zack,

On Sun, 14 Mar 2021 at 22:40, Zack Weinberg <zackw@panix.com> wrote:
>
> 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.

I agree. Do you want to add an "Acked-by:"?

Thanks,

Michael

> 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.




-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2021-03-14 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14 16:01 Alejandro Colomar
2021-03-14 21:40 ` Zack Weinberg
2021-03-14 22:00   ` Michael Kerrisk (man-pages) [this message]
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='CAKgNAkj7NjNMTKct3FGOZBLfZESLDo=1Le-da41LVa-PeQ9w0Q@mail.gmail.com' \
    --to=mtk.manpages@gmail.com \
    --cc=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=zackw@panix.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 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).