From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cygnus.enyo.de (cygnus.enyo.de [79.140.189.114]) by sourceware.org (Postfix) with ESMTPS id 854E93858D1E for ; Wed, 1 Nov 2023 07:38:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 854E93858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 854E93858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=79.140.189.114 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698824302; cv=none; b=D77pD1140VNLQOUxpRs0SU5oPvdekdv8QoVIsKLBi5RBhcfkZeqWWQUrbha/PP3XJE1XE3q+VNiff3ubapl2GXBoA74w6+r3u3JSmqq8uPs8TYgmSA7szc/i95Ub62tCs6QkRHSKLNtjp2r4woADQMJuqKbUNjLhtWjgQwn54rY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698824302; c=relaxed/simple; bh=kJsTsr+NMxBnOFUvwk9tSdODtA9DFkHF9TjYvkvVBII=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ptqJm60C/Dx0eM0jvrTG17g/16WSz31xHBNMzB0hFkdliP3jqJ2m9+bg8oLMoCbXspS9H8bHACxif1mH+CCA8DrrV3QD8HSN1rG4cWxrRkgJXs54LO7QPfeR8oT09z6J/CBZn0ed9L1JIjVpQe7hdaaesTS1XwYsvQ/1TFWInH0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [172.17.203.2] (port=42077 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1qy5ns-00ENAB-3g; Wed, 01 Nov 2023 07:38:17 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.96) (envelope-from ) id 1qy5nt-0002cv-01; Wed, 01 Nov 2023 08:38:17 +0100 From: Florian Weimer To: Paul Eggert Cc: Jonny Grant , Adhemerval Zanella Netto , GNU C Library , Xi Ruoyao Subject: Re: glibc misc/sys/cdefs.h nonull - typo in comment References: <25d0b6fa-7b45-3f8e-946a-ad3256e211a4@jguk.org> <0d99df74-fb83-1647-ca19-17d2229f0ae0@linaro.org> <514c11a4-405b-f7f3-9a67-0b6c10ad7740@jguk.org> <21bc9125ab8ced26aa85f3f787f084c4af460a18.camel@xry111.site> <84e4081c-35ef-4f2d-89d0-0fea04732737@cs.ucla.edu> Date: Wed, 01 Nov 2023 08:38:16 +0100 In-Reply-To: <84e4081c-35ef-4f2d-89d0-0fea04732737@cs.ucla.edu> (Paul Eggert's message of "Sat, 28 Oct 2023 22:24:14 -0700") Message-ID: <87cywtvs7r.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Paul Eggert: > The April 2023 working draft of C23 has adjusted the wording to be the > following, and I expect POSIX to follow suit eventually. Notice the new > restrictions: > > "If an argument to a function has an invalid value (such as a value > outside the domain of the function, or a pointer outside the address > space of the program, or a null pointer, or a pointer to non-modifiable > storage when the corresponding parameter is not const-qualified) or a > type (after default argument promotion) not expected by a function with > a variable number of arguments, the behavior is undefined. > > "If a function argument is described as being an array, the pointer > actually passed to the function shall have a value such that all address > computations and accesses to objects (that would be valid if the pointer > did point to the first element of such an array) are in fact valid.[210] > > "[210] This includes, for example, passing a valid pointer that points > one-past-the-end of an array along with a size of 0, or using any valid > pointer with a size of 0." I'm not sure if these are new restrictions. Doesn't this make previously undefined behavior when calling strncmp with shorter strings defined?