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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/2/20 8:14 AM, Alejandro Colomar wrote:

+.I void *

GNU style is a space between "void" and "*", so this should be '.I "void\ *"', both here and elsewhere. The backslash prevents a line break.

+Conversions from and to any other pointer type are done implicitly,
+not requiring casts at all.
+Note that this feature prevents any kind of type checking:
+the programmer should be careful not to cast a

Change "cast" to "convert", since the point is that no cast is needed.

+.PP
+The conversion specifier for
+.I void *
+for the
+.BR printf (3)
+and the
+.BR scanf (3)
+families of functions is
+.BR p ;
+resulting commonly in
+.B %p
+for printing
+.I void *
+values.

%p works with any object pointer type (or in POSIX, any pointer type), not just void *.

Should also mention "void const *", "void volatile *", etc. Plus it really should talk about plain "void", saying that it's a placeholder as a return value for functions, for casting away values, and as a keyword in C11 for functions with no parameters (though this is being changed in the next C version!). I sent comments about most of this stuff already.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux