From nobody Mon Jul 15 12:38:35 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 4WN1vv6Qccz5QrrY; Mon, 15 Jul 2024 12:38:35 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vv46kfz4J2K; Mon, 15 Jul 2024 12:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047115; 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=gV1CsYI7/oGsL0y8v/QYDvkjLc44xZNHwV7XETC6DRw=; b=Etz/YgaeR3w4j3lqbMfnGlxME1Zvf4o5XcNytLXbUla5udCT9ZEl2F6lFaFQ7PUqtz/Fhp NMXxYg3b237Xs2MUZdKiBmT3hoSbDXEo69W5oQg3gj5hKgtDvDzgo94Spr4Ii9ekCuU0Mz 6t0r96zrab7G6tRxZO3ADTjWYRi2EwwUjb+dC7/A53GXTi+pxayCJdz7i0xIsiWJFRXWdr wWdQmj/PI4hjNGm2imTkwi05C56He+IfpL317a/aL5M3Wbf+CoBk70EIc2LIFnY0tCHPtP nXU3x1cSuCH/hr1pqHimNawR15hOg5IUzGFzwcDHtCEYHSoynis29+efA7zfVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047115; a=rsa-sha256; cv=none; b=jhuLcDF3gHnOqEN49eWFvw3gEBOjs34hnp+5YUp/ZisAiu6yhmyPdH/+FRDvJv2jRlXbXd WnPOP0DglcsyiV7RSPenLIxymXgCpozTeMIe/9h5SOuu0X9Tn1Eb8qU+MUY0cMM12S5nKQ mum+nob4m1kTjvKUu9orU1zxDBY5iHERM8sA4jwQQhfZGCI1txzStdTGrWwYFkTpSqr87a lIKFEH2vikICmiF8GxV06Ld+Y1MBvAQ2/Osv7b18tyxmiiuLbaaWYK4+ydA0ZmzjIQzbkf GEkC4frf0fXc7DghoqB3goK8a54io3dkopp6URLObAJuH/ynRnCyNo+fOr8NHg== 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=1721047115; 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=gV1CsYI7/oGsL0y8v/QYDvkjLc44xZNHwV7XETC6DRw=; b=QnvjSJ/FvrtwGq67tXJuG/QsR5KsjiLEaDRnN3l49QRM4tEH10sJQG+KhnogUe+Alv50WZ JeEjCiPsS1r3IFem52XxGUF7SUN+DGHBUfarYE/aFX4r2SWam4jLdrwi7bzqAdDRYHVMdL Y3yOmJqatlBCDJ2Bv9wZ0CE7tRpt4hnvMrbwDmxuNWDkf4mkpl30vP54XqPbHT3QByjhZY SNWV38xpbT4PK1wsGzpm3RUpKtN07V4XTWKqZ2Bi7iR1gPGmgLkAiF4vP33Pdo14Bp01/m wmPH1vAr/wArxNGrlD5ij+Y6wxuTKARA4gqVpkowIr4MmZgxZSBBhODRUyOtIQ== 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 4WN1vv3j5xzspJ; Mon, 15 Jul 2024 12:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCcZtP062108; Mon, 15 Jul 2024 12:38:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcZcB062105; Mon, 15 Jul 2024 12:38:35 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:35 GMT Message-Id: <202407151238.46FCcZcB062105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 066069197864 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 06606919786416d9854a16ad856ed89582856f16 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=06606919786416d9854a16ad856ed89582856f16 commit 06606919786416d9854a16ad856ed89582856f16 Author: Andrew Turner AuthorDate: 2024-06-12 13:04:13 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:35:21 +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 (cherry picked from commit a7ae78caaa17ff840da844c1dcaa780d194c9e20) --- sys/sys/cdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index df15a3c04193..d9e1c476f1ef 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -219,6 +219,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)))