lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b86f6e9-0d8a-f14a-73ce-ebbdc9d9edba@gmail.com>
Date:   Fri, 2 Oct 2020 10:24:39 +0200
From:   Alejandro Colomar <colomar.6.4.3@...il.com>
To:     Paul Eggert <eggert@...ucla.edu>
Cc:     mtk.manpages@...il.com, linux-man@...r.kernel.org,
        libc-alpha@...rceware.org, gcc@....gnu.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] system_data_types.7: Add 'void *'

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ