From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 768E51F601 for ; Sat, 3 Dec 2022 19:05:50 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FFA538582A3 for ; Sat, 3 Dec 2022 19:05:49 +0000 (GMT) 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-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: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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."