From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by sourceware.org (Postfix) with ESMTPS id 196453858D20 for ; Sat, 3 Dec 2022 19:05:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 196453858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nefkom.net Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4NPfQk3vtJz1s89n; Sat, 3 Dec 2022 20:05:34 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4NPfQk3VmTz1qqlR; Sat, 3 Dec 2022 20:05:34 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id Xc7N0p2GAv_z; Sat, 3 Dec 2022 20:05:33 +0100 (CET) X-Auth-Info: 7lyYRrRnxbB7WIipoLTGnKJsfam3e/r8uHVSmQqDBimmJNXCCLZ1UxjK2wiXMBy/ Received: from igel.home (aftr-62-216-205-80.dynamic.mnet-online.de [62.216.205.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 3 Dec 2022 20:05:33 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 7E14C2C31BD; Sat, 3 Dec 2022 20:05:33 +0100 (CET) From: Andreas Schwab To: Xi Ruoyao via Libc-alpha Cc: Alejandro Colomar , Xi Ruoyao Subject: Re: bind(2): Missing [[gnu::nonnull]] References: <8292ef824696e0fbac4f4ed036aad43c0458b8a2.camel@xry111.site> X-Yow: Should I start with the time I SWITCHED personalities with a BEATNIK hair stylist or my failure to refer five TEENAGERS to a good OCULIST? Date: Sat, 03 Dec 2022 20:05:33 +0100 In-Reply-To: <8292ef824696e0fbac4f4ed036aad43c0458b8a2.camel@xry111.site> (Xi Ruoyao via Libc-alpha's message of "Sat, 03 Dec 2022 23:55:06 +0800") Message-ID: <87wn78cnpe.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Dez 03 2022, Xi Ruoyao via Libc-alpha wrote: > Currently the man page says: > > EFAULT: addr points outside the user's accessible address space. > > And bind(2) indeed sets errno to EFAULT and return -1 when NULL is > passed as addr. You can never depend on EFAULT for invalid addresses. > gnu::nonnull is not only a diagnostic attribute: it also allows the > compiler to assume addr is never NULL. i. e. if addr was gnu::nonnull > and bind(2) is called with addr == NULL, the behavior would be > undefined. It is already undefined now, so this would be a valid change. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."