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: <20201002094451.17997-1-colomar.6.4.3@gmail.com>
Date:   Fri,  2 Oct 2020 11:44:52 +0200
From:   Alejandro Colomar <colomar.6.4.3@...il.com>
To:     mtk.manpages@...il.com, eggert@...ucla.edu, David.Laight@...LAB.COM
Cc:     Alejandro Colomar <colomar.6.4.3@...il.com>,
        linux-man@...r.kernel.org, gcc-patches@....gnu.org,
        libc-alpha@...rceware.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic

Reported-by: Paul Eggert <eggert@...ucla.edu>
Reported-by: David Laight <David.Laight@...LAB.COM>
Signed-off-by: Alejandro Colomar <colomar.6.4.3@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ