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 727D23842433 for ; Fri, 2 Oct 2020 19:32:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 727D23842433 Received: by mail-wr1-x441.google.com with SMTP id m6so3004368wrn.0 for ; Fri, 02 Oct 2020 12:32:48 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=9WAVTTZWVXFPkge+R2T9ftB7ZAz6PRmo0VTImnGOdmU=; b=TeoW4rAY/WeQpTWtd6qyO01Ormob4/RO0ULNhzu/wMm0dyHA4BfXghdMpXIUOb/b1X nYkovPSCr9aDHzHXuhvKxvzJ2rdx8/kWL3hcL2PDhrpkdWk9WFIxhKRuSETqO/Dzb9S9 nskuMiYMrzZcB0b3Z2TIYkY7HGZGH+aqD0q2g9PvKnXILNZ1K9cYI/Oi0YtXzG1u1NSU SRcOPhtvGf0MExMV1CLIy3X2ChbmX8RZxTziyW3TNmDUmx2cdFObY+MZ6+QWK4oVtS9k oKMlckDxXjA/hS64wMclA6pD2Mqll6G9cfyLBknMUxVNSwsQ2IkmKTc7zFac1OnqPur+ yw3g== X-Gm-Message-State: AOAM5324lBOtB5pSs0jJ/x5iRlMKrPBVjJxyGe/XWE3fLFY16ptr6Rf6 WrQmBMgpOqK7bNt6FKBB8Ik= X-Google-Smtp-Source: ABdhPJyfBT9pQo+SXX/SVRxX/51ZMMtCA1RJUScUOWnhvtrYzg/bRzDFelbWIbR8mn6HmKSq2i0djg== X-Received: by 2002:adf:f6c8:: with SMTP id y8mr4972404wrp.217.1601667167512; Fri, 02 Oct 2020 12:32:47 -0700 (PDT) Received: from localhost.localdomain ([170.253.60.68]) by smtp.googlemail.com with ESMTPSA id e19sm3384230wme.2.2020.10.02.12.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 12:32:46 -0700 (PDT) From: Alejandro Colomar To: mtk.manpages@gmail.com Cc: Alejandro Colomar , linux-man@vger.kernel.org, gcc-patches@gcc.gnu.org, libc-alpha@sourceware.org, eggert@cs.ucla.edu, linux-kernel@vger.kernel.org, jwakely.gcc@gmail.com, David.Laight@ACULAB.COM Subject: [PATCH v5 0/2] Document 'void *' Date: Fri, 2 Oct 2020 21:28:13 +0200 Message-Id: <20201002192814.14113-1-colomar.6.4.3@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201002151419.32053-1-colomar.6.4.3@gmail.com> References: <20201002151419.32053-1-colomar.6.4.3@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, 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 19:32:49 -0000 Hi Michael, Here I added a wfix fixing some wording issues and a few typos spotted by Paul and Jonathan in the (many) threads. As previously, it is squashed into a single commit. Thanks again for those who reviewed the patch! BTW, for those who don't have a local repo of the man-pages, below you can see a rendered version of the patch. Thanks, Alex [[ void * According to the C language standard, a pointer to any object type may be converted to a pointer to void and back. POSIX fur- ther requires that any pointer, including pointers to functions, may be converted to a pointer to void and back. Conversions from and to any other pointer type are done implic- itly, not requiring casts at all. Note that this feature pre- vents any kind of type checking: the programmer should be care- ful not to convert a void * value to a type incompatible to that of the underlying data, because that would result in undefined behavior. This type is useful in function parameters and return value to allow passing values of any type. The function will typically use some mechanism to know the real type of the data being passed via a pointer to void. A value of this type can't be dereferenced, as it would give a value of type void, which is not possible. Likewise, pointer arithmetic is not possible with this type. However, in GNU C, pointer arithmetic is allowed as an extension to the standard; this is done by treating the size of a void or of a function as 1. A consequence of this is that sizeof is also allowed on void and on function types, and returns 1. The conversion specifier for void * for the printf(3) and the scanf(3) families of functions is p. Versions: The POSIX requirement about compatibility between void * and function pointers was added in POSIX.1-2008 Technical Cor- rigendum 1 (2013). Conforming to: C99 and later; POSIX.1-2001 and later. See also: malloc(3), memcmp(3), memcpy(3), memset(3) See also the intptr_t and uintptr_t types in this page. ]] Alejandro Colomar (2): system_data_types.7: Add 'void *' void.3: New link to system_data_types(7) man3/void.3 | 1 + man7/system_data_types.7 | 76 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 man3/void.3 -- 2.28.0