From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by sourceware.org (Postfix) with ESMTPS id 61516386F027 for ; Fri, 2 Oct 2020 09:45:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 61516386F027 Received: by mail-wr1-x441.google.com with SMTP id j2so1064501wrx.7 for ; Fri, 02 Oct 2020 02:45:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=G+ywyTrniNZc042b3yFhIv1wH4T4KbyH6D7/fYEWnm4=; b=nQe1Pm7sNQbrLuPSo49FZCKu7JNhw1seAvkSaOLZ8DXPc/PiCBWsWFWYrDWOcjn9sp WMgcUl4AcYlIkUqS573/yNlnRhi7yCU+sXwIPpEmlXwPQX7q8RgY6tQuWWl7mTgu6R+r 2JGS4s0sZ/xp7kyyxzCn02yB5dUpH67XQAb/+Bhhjq8yRT0DeHuEGULhDFSsFRXHvc1+ PJ8njGNVohaaSwJdLLTP027XLGbXAbKKIvqEo+UAprGr5jZPfsZXwgjHyrHcGdHVBJHa Cwv0NmEW6fhV3tQGGkcYcYT4Gz3xsFQDLh3NxcS22nBFRLWZg9qXSJszQMoI/8WOCYmc 8CNw== X-Gm-Message-State: AOAM533spT7navEDKzE0KwILiFej+vB5xf4pub6yKJgEQhhXiZRZDRTr +cewAyzZ071lHk1lrF6H/kMjwSDZ61U= X-Google-Smtp-Source: ABdhPJzXe8k6dcR3DjnkMU9AMtiAvQ/kGURK1+JsLr3OZy4mgplWhp+Uw8QP4e9vxeRF6bXACNIV2A== X-Received: by 2002:adf:ef4a:: with SMTP id c10mr1950027wrp.13.1601631940551; Fri, 02 Oct 2020 02:45:40 -0700 (PDT) Received: from localhost.localdomain ([170.253.60.68]) by smtp.googlemail.com with ESMTPSA id x17sm1210985wrg.57.2020.10.02.02.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 02:45:40 -0700 (PDT) From: Alejandro Colomar To: mtk.manpages@gmail.com, eggert@cs.ucla.edu, David.Laight@ACULAB.COM Cc: Alejandro Colomar , linux-man@vger.kernel.org, gcc-patches@gcc.gnu.org, libc-alpha@sourceware.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] system_data_types.7: void *: Add info about pointer artihmetic Date: Fri, 2 Oct 2020 11:44:52 +0200 Message-Id: <20201002094451.17997-1-colomar.6.4.3@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2020 09:45:42 -0000 Reported-by: Paul Eggert Reported-by: David Laight Signed-off-by: Alejandro Colomar --- 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