[PATCH v2 1/2] system_data_types.7: Add 'void *'

Paul Eggert eggert@cs.ucla.edu
Thu Oct 1 17:32:14 GMT 2020


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.

For 'void *' you should also mention that one cannot use arithmetic on void * 
pointers, so they're special in that way too. 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. It might not also hurt to 
mention 'void const *', 'void volatile *', 'void const volatile *', etc.

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.

You're starting to document the C language here, and if you're going to do that 
you might as well do it right.


More information about the Gcc mailing list