Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic
@ 2020-10-02  9:44 Alejandro Colomar
  2020-10-02  9:46 ` Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar @ 2020-10-02  9:44 UTC (permalink / raw)
  To: mtk.manpages, eggert, David.Laight
  Cc: Alejandro Colomar, linux-man, gcc-patches, libc-alpha, linux-kernel

Reported-by: Paul Eggert <eggert@cs.ucla.edu>
Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---

Paul and David,
Thanks for your input!

Alex


 man7/system_data_types.7 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index 6451782db..bc7d5a8a0 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -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 *
-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic
  2020-10-02  9:44 [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic Alejandro Colomar
@ 2020-10-02  9:46 ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2020-10-02  9:46 UTC (permalink / raw)
  To: mtk.manpages, eggert, David.Laight
  Cc: linux-man, gcc-patches, libc-alpha, linux-kernel

Hi Michael,

The 2/2 is a typo.  This is a standalone patch.

Cheers,

Alex

On 2020-10-02 11:44, Alejandro Colomar wrote:
> Reported-by: Paul Eggert <eggert@cs.ucla.edu>
> Reported-by: David Laight <David.Laight@ACULAB.COM>
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
> 
> Paul and David,
> Thanks for your input!
> 
> Alex
> 
> 
>   man7/system_data_types.7 | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
> index 6451782db..bc7d5a8a0 100644
> --- a/man7/system_data_types.7
> +++ b/man7/system_data_types.7
> @@ -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 *
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02  9:44 [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic Alejandro Colomar
2020-10-02  9:46 ` Alejandro Colomar

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git