linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Alejandro Colomar <colomar.6.4.3@gmail.com>,
	Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: mtk.manpages@gmail.com, Paul Eggert <eggert@cs.ucla.edu>,
	linux-man <linux-man@vger.kernel.org>,
	GNU C Library <libc-alpha@sourceware.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	Paul Eggert <eggert@cs.ucla.edu>,
	David.Laight@ACULAB.COM
Subject: Navigational corrections (was: Re: [PATCH v2 1/2] system_data_types.7: Add 'void *')
Date: Sat, 3 Oct 2020 10:00:49 +0200	[thread overview]
Message-ID: <297e304a-758e-f703-d1e2-6708be3ffca8@gmail.com> (raw)
In-Reply-To: <4422e4bc-f54c-02cf-9b47-808d07ce8ba5@gmail.com>

Hi Alex, et al.
On 10/2/20 3:51 PM, Alejandro Colomar wrote:
> 
> Hi Jonathan,
> 
> On 2020-10-02 15:27, Jonathan Wakely wrote:
>> On Fri, 2 Oct 2020 at 14:20, Alejandro Colomar <colomar.6.4.3@gmail.com> wrote:
>>>
>>>
>>>
>>> On 2020-10-02 15:06, Jonathan Wakely wrote:
>>>   > On Fri, 2 Oct 2020 at 12:31, Michael Kerrisk (man-pages)
>>>   > <mtk.manpages@gmail.com> wrote:
>>>   >>
>>>   >> On Fri, 2 Oct 2020 at 12:49, Jonathan Wakely <jwakely.gcc@gmail.com>
>>> wrote:
>>>   >>>
>>>   >>> On Fri, 2 Oct 2020 at 09:28, Alejandro Colomar via Gcc
>>> <gcc@gcc.gnu.org> wrote:
>>>   >>>> However, it might be good that someone starts a page called
>>>   >>>> 'type_qualifiers(7)' or something like that.
>>>   >>>
>>>   >>> Who is this for? Who is trying to learn C from man pages? Should
>>>   >>> somebody stop them?
>>>   >>
>>>   >> Yes, I think so. To add context, Alex has been doing a lot of work to
>>>   >> build up the new system_data_types(7) page [1], which I think is
>>>   >> especially useful for the POSIX system data types that are used with
>>>   >> various APIs.
>>>   >
>>>   > It's definitely useful for types like struct siginfo_t and struct
>>>   > timeval, which aren't in C.
>>>
>>> Hi Jonathan,
>>>
>>> But then the line is a bit diffuse.
>>> Would you document 'ssize_t' and not 'size_t'?
>>
>> Yes. My documentation for ssize_t would mention size_t, refer to the C
>> standard, and not define it.
>>
>>> Would you not document intN_t types?
>>> Would you document stdint types, including 'intptr_t', and not 'void *'?
>>
>> I would document neither.
>>
>> I can see some small value in documenting size_t and the stdint types,
>> as they are technically defined by the libc headers. But documenting
>> void* seems very silly. It's one of the most fundamental built-in
>> parts of the C language, not an interface provided by the system.
>>
>>> I guess the basic types (int, long, ...) can be left out for now,
>>
>> I should hope so!
>>
>>> and apart from 'int' those rarely are the most appropriate types
>>> for most uses.
>>> But other than that, I would document all of the types.
>>> And even... when all of the other types are documented,
>>> it will be only a little extra effort to document those,
>>> so in the future I might consider that.
>>
>> [insert Jurassic Park meme "Your scientists were so preoccupied with
>> whether or not they could, they didn't stop to think if they should."
>> ]
>>
>> I don't see value in bloating the man-pages with information nobody
>> will ever use, and which doesn't (IMHO) belong there anyway. We seem
>> to fundamentally disagree about what the man pages are for. I don't
>> think they are supposed to teach C programming from scratch.
> 
> Agree in part.
> I'll try to think about it again.
> 
> In the meantime, I trust Michael to tell me when something is way off :)
> 
> Thanks, really!
> 
> Alex

So, I think a navigational correction is needed.

My vision was that system_data_types(7) would most usefully document 
the POSIX types, but by now there's too much of C creeping in. I have
been a little slow to react to that, and I apologize for that.
But I think we should not go in that direction

I think it is worth having types like ssize_t and size_t in 
the page, simply because they turn up with so many of the POSIX
APIs, and people often don't understand some details of these
types (such as the necessary prinf() specifiers). So, as long as
we're going to have a page about these types, it's fine by
me to include size_t and ssize_t.

Types like [u]intN_t are definitely on the borderline for me. But,
they do appear in various APIs in the Linux interface (either
explicitly, or as the similar __u32 ___64, etc.). And again
many people don't understand some basic details, such as
the PRI and SCN constants, so I think it is useful to have them
briefly summarized in one place, and as long as they are already
in the page, then let's keep them.

I think __int128 etc definitely doesn't belong in this page.

And I'd like to back pedal a bit. I think we really shouldn't have
[u]int_fastN_t
[u]int_leastN_t
in the page. They are C details that have nothing to with POSIX, 
the kernel, or libc. Could you send me a patch to remove these
from the page? And again, my apologies for not being focused 
enough on the big picture sooner.

I don't think 'void' belongs in this page. Nor basic types
such as int, long, etc.

The question of 'void *' is an interesting one. It is something
like a fundamental C type, and not something that comes from POSIX.
But, it does appear in POSIX APIs and often details of using
the type are not well understood. So, as a matter of practicality,
and again since you've done the work, I am inclined to include
this type in the page, just so it can be handily referred to
along with all of the other types.

Looking ahead (and I hope none of the above disheartens you,
since you've done a lot of great work for this page), it would
be good if you could provide a bit of an advance roadmap about
the types that you'd like to add to the page.

Thanks,

Michael



-- 
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:[~2020-10-03  8:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 15:06 [PATCH 0/2] Document void * Alejandro Colomar
2020-10-01 15:06 ` [PATCH 1/2] system_data_types.7: Add 'void *' Alejandro Colomar
2020-10-01 15:06 ` [PATCH 2/2] void-*.3: New link to system_data_types(7) Alejandro Colomar
2020-10-01 15:34 ` [PATCH 0/2] Document void * Michael Kerrisk (man-pages)
2020-10-01 15:40   ` Alejandro Colomar
2020-10-01 15:49     ` [PATCH v2 0/2] Document 'void *' Alejandro Colomar
2020-10-01 15:49     ` [PATCH v2 1/2] system_data_types.7: Add " Alejandro Colomar
2020-10-01 16:38       ` Michael Kerrisk (man-pages)
2020-10-01 16:55         ` Alejandro Colomar
2020-10-02 11:54           ` Michael Kerrisk (man-pages)
2020-10-08 13:52           ` Vincent Lefevre
2020-10-12  9:36             ` Michael Kerrisk (man-pages)
2020-10-01 17:32       ` Paul Eggert
2020-10-02  8:24         ` Alejandro Colomar
2020-10-02  8:48           ` Alejandro Colomar
2020-10-02 11:44             ` Michael Kerrisk (man-pages)
2020-10-02  9:10           ` David Laight
2020-10-02 17:00             ` Paul Eggert
2020-10-02 10:49           ` Jonathan Wakely
2020-10-02 11:31             ` Michael Kerrisk (man-pages)
2020-10-02 13:06               ` Jonathan Wakely
2020-10-02 13:20                 ` Alejandro Colomar
2020-10-02 13:27                   ` Jonathan Wakely
2020-10-02 13:51                     ` Alejandro Colomar
2020-10-03  8:00                       ` Michael Kerrisk (man-pages) [this message]
2020-10-03  9:16                         ` Navigational corrections Alejandro Colomar
2020-10-03 11:39                           ` Michael Kerrisk (man-pages)
2020-10-05 22:08                             ` Alejandro Colomar
2020-10-07  6:53                               ` Michael Kerrisk (man-pages)
2020-10-01 15:49     ` [PATCH v2 2/2] void.3: New link to system_data_types(7) Alejandro Colomar
2020-10-02 13:19     ` [PATCH 0/2] Document void * Jonathan Wakely
2020-10-03 11: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=297e304a-758e-f703-d1e2-6708be3ffca8@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=colomar.6.4.3@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=gcc@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.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 NNTP newsgroup(s).