From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org,
libc-alpha@sourceware.org, gcc@gcc.gnu.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] system_data_types.7: Add 'void *'
Date: Fri, 2 Oct 2020 10:24:39 +0200 [thread overview]
Message-ID: <4b86f6e9-0d8a-f14a-73ce-ebbdc9d9edba@gmail.com> (raw)
In-Reply-To: <538b683f-01d2-6148-4f1d-1b293eb5cd6b@cs.ucla.edu>
Hi Paul,
On 2020-10-01 19:32, Paul Eggert wrote:
> If you're going to document this at all, I suggest documenting 'void' as
> well as 'void *', and putting both sets of documentation into the same
> man page.
>
All the types we're documenting are in the same page:
system_data_types(7).
And then we have links with the name of each type.
And yes, I also pretend to document 'void'.
> For 'void *' you should also mention that one cannot use arithmetic on
> void * pointers, so they're special in that way too.
Good suggestion!
> Also, you should
> warn that because one can convert from any pointer type to void * and
> then to any other pointer type, it's a deliberate hole in C's
> type-checking.
Also good. I'll talk about generic function parameters for this.
> It might not also hurt to mention 'void const *', 'void
> volatile *', 'void const volatile *', etc.
Those are qualifiers for the type,
and I don't see how any of them would apply differently to 'void *'
than to any other pointer type (or any type at all),
so I think they don't belong to system_data_types(7).
However, it might be good that someone starts a page called
'type_qualifiers(7)' or something like that.
I would love that someone documents 'volatile' correctly,
as there aren't many good sources about it.
If someone who knows when to use --and especially when not to use--
'volatile', is reading this, think about it :-)
I still wonder if I used it correctly in the few cases I've had to.
BTW, I'll CC the LKML.
>
> For 'void' you can mention the usual things, such as functions returning
> void, and functions declared with (void) parameters, why one would want
> to cast to (void), and so forth.
Yes, I was thinking about that.
>
> You're starting to document the C language here, and if you're going to
> do that you might as well do it right.
I'm trying to do so :)
Thanks,
Alex
next parent reply other threads:[~2020-10-02 8:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <41affebd-3354-9420-0048-bffd14535e95@gmail.com>
[not found] ` <20201001154946.104626-2-colomar.6.4.3@gmail.com>
[not found] ` <538b683f-01d2-6148-4f1d-1b293eb5cd6b@cs.ucla.edu>
2020-10-02 8:24 ` Alejandro Colomar [this message]
2020-10-02 8:48 ` [PATCH v2 1/2] system_data_types.7: Add 'void *' 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 ` Navigational corrections (was: Re: [PATCH v2 1/2] system_data_types.7: Add 'void *') Michael Kerrisk (man-pages)
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)
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=4b86f6e9-0d8a-f14a-73ce-ebbdc9d9edba@gmail.com \
--to=colomar.6.4.3@gmail.com \
--cc=eggert@cs.ucla.edu \
--cc=gcc@gcc.gnu.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-kernel@vger.kernel.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 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).