From nobody Wed Jun 12 15:51:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VzqlB39yHz5Mxc8; Wed, 12 Jun 2024 15:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VzqlB2lBhz4Yl5; Wed, 12 Jun 2024 15:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718207462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PfStr5x6YKtunz+h8qBVsH7bwK0Re2e3rJRPzGrjdZ0=; b=E9c1nF/5SUA34iTnDht+Ac7WKPD9vqS4IilTXlPopuI2x99keUTUPP69r31c9YOoa2Q1ud wZh6gAwN69PPi507kvp0Rvqe0G21gPXWzYnOrmNvD6UJL0hK7TqtXQtFcAEJ4fcd+I24W+ aqfYg2lq2MY4ENzGS/144SAgiBkIiztOHZprWKGFb3sAFevautliX+PduhkXtyc7wLu9v5 8hrzdSatYLNbXxXBlgFVnjKyXSYsC76eccvTbxn3KVOHdObTIvknlO7GAddj0hcBB1TmoZ qy4xn8B4HX4BKHPy2XyQgHKJLQP97nUNFtZ1Z/R1WbiqbAmCO7Dl8vmlJtl0iA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718207462; a=rsa-sha256; cv=none; b=jScQguO8EyueeH3gTvi+ABOxsQKqGfrMg49Uq7ba9UsruohJfAe51OqwnvnXViKAt1/ojo 4yegx+pep0b2nRPqHaLEJUOMan5DduIDWmk1vuOb0T+KvnWR7V3zg2Me4uOpxL5Dx/wvyf niYXBCf/xrsJ8H8EHi/H2YeodtIPxZZIm3RbxQKPBkCbLH9qCqyicRfKcN32OH1acWbhgM U2GcHuiBXkGg+kVHKlBP41V6jIwkBfqedrpMbZI5MX9V4yhAdaaGxRO4Tc6ucQDNNJ+uUi vIeujQA4fsBbKnM9cFP0vNaaNY2wmEH2IlfD/RT2afWOWO+FQitcje5XRKoUlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718207462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PfStr5x6YKtunz+h8qBVsH7bwK0Re2e3rJRPzGrjdZ0=; b=SAsBp4EKqApHpwPZ4g/AUKwzPehnpDE/so12TcHZ86P4vSmubI1du2FXu7pUalWh9a0FyL ix2l+z//SoH8ReqjyjpoEJz6kfhS/Ih1ZIXkwuKbIgO4JSwX+uW1iDr4NHRKFw37QprX7S HTE81BPl8YD7fRJb2S6wvGONIwf90mbBr0g0VREBclml8v94Nh73hRUH0dEODrI5Hw0p1O pv+14s9lqBh1hNT+Cpo5mA5BLGvLR0YZiL+10PeRtzmbvVOI38O6sOKBewu4Mzk1K5o+3D TBGsfO8SqHuAHwqHdJMsb7MxPC0RHfSKJanXt93UFsBMa9fGy7H0juGYwk012w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VzqlB2LqpzySG; Wed, 12 Jun 2024 15:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CFp21N057431; Wed, 12 Jun 2024 15:51:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CFp29C057428; Wed, 12 Jun 2024 15:51:02 GMT (envelope-from git) Date: Wed, 12 Jun 2024 15:51:02 GMT Message-Id: <202406121551.45CFp29C057428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a7ae78caaa17 - main - cdefs: Add __writeonly to mark write only vars List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7ae78caaa17ff840da844c1dcaa780d194c9e20 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a7ae78caaa17ff840da844c1dcaa780d194c9e20 commit a7ae78caaa17ff840da844c1dcaa780d194c9e20 Author: Andrew Turner AuthorDate: 2024-06-12 13:04:13 +0000 Commit: Andrew Turner CommitDate: 2024-06-12 13:04:13 +0000 cdefs: Add __writeonly to mark write only vars When a variable in write only and can't be removed, e.g. for API reasons, it is useful to document this fact similar to __diagused and __witness_used. Add __writeonly to tell the compiler and anyone looking at the code that this variable is expected to only be written to, and to not raise and error. Reviewed by: imp, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45561 --- sys/sys/cdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 037dfa55f923..c3268791787f 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -180,6 +180,7 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) #endif +#define __writeonly __unused #if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) #define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x)))