system_data_types.7: void *: Add info about pointer artihmetic
PATCH 2/2 system_data_types.7: void *: Add info about pointer artihmetic
Reported-by Paul Eggert <[email protected]>
Reported-by David Laight <[email protected]>
Signed-off-by Alejandro Colomar <[email protected]>
---
Paul and David,
Thanks for your input!
Alex
man7/system_data_types.7 | 11 +++++++++++ 1 file changed, 11 insertions(+)
man7/system_data_types.7 +11 -0
@@ -1918,6 +1918,17 @@ A value of this type can't be dereferenced, as it would give a value of type .I void which is not possible. +Likewise, pointer arithmetic is not possible with this type. +However, in GNU C, poitner arithmetic is allowed +as an extension to the standard; +this is done by treating the size of a +.I void +or of a function as 1. +A consequence of this is that +.I sizeof +is also allowed on +.I void +and on function types, and returns 1. .PP The conversion specifier for .I void *
Signature · 1 line
2.28.0
Hi Michael,
The 2/2 is a typo. This is a standalone patch.
Cheers,
Alex
Quoted 37 lines · Alejandro Colomar
Reported-by Paul Eggert <[email protected]>Reported-by David Laight <[email protected]>Signed-off-by Alejandro Colomar <[email protected]>---
Paul and David,
Thanks for your input!Alex
man7/system_data_types.7 | 11 +++++++++++ 1 file changed, 11 insertions(+)man7/system_data_types.7 +11
-0@@ -1918,6 +1918,17 @@ A value of this type can't be dereferenced, as it would give a value of type .I void which is not possible. +Likewise, pointer arithmetic is not possible with this type. +However, in GNU C, poitner arithmetic is allowed +as an extension to the standard; +this is done by treating the size of a +.I void +or of a function as 1. +A consequence of this is that +.I sizeof +is also allowed on +.I void +and on function types, and returns 1. .PP The conversion specifier for .I void *