From nobody Mon Jul 15 12:38:32 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 4WN1vs46vZz5Qrhf; Mon, 15 Jul 2024 12:38:33 +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 4WN1vr6X7Xz4J1h; Mon, 15 Jul 2024 12:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047112; 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=5bplBUzSyPOsFzM0n5BPU3rvII1U5X9JvN975aJGUwc=; b=W2BIM8nUjmUKTq38aD2nHUP4dWzpqUupyC/dyAQiLOHgjfyufbmmrhPnN3eIlgakrcX5iN ofiwbivCueOdGFmfCRei35mt6q1VlRh2JYCi/ZmN8ks+2Jj1cxUTVWYkt8jTD/wqYXLLKe BC3JFsSGwAQT/j2dBrUEG9NyRxpGiHgx6+59Co9GQucwZmcf+NkDWJ95FVObzSbydpWNiE GhriV4H/qMhL7ufhAqGNctgH2RNuxVBJBKf/CbxdKLk788tF8/3tkgwVCV4wVbZqgQWzyw SNhBlExXJKJ0Q7m1qqZevvNj0HWsPXbvMhSmysMgiZbivC+jiD0jmCBg5I7tzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047112; a=rsa-sha256; cv=none; b=u61RvXDp/ucEHaXiq6FE7ptMGX+lLhMlYFW5rhWdlBEh423rYBc1W3NB+bQ/Qb+bKYoFhA WoV7TkcZW+IK5IZWQECVXo5KN7HNpDwpJUidETwHzIRmb10ZNCt3KhaWFBM2Z7s6IgZG0n np4updWSgFsFF6cc1tqw1knQoESMimtkRK0qbXKYhZspVEs35qkDHAWdObTMiwHU0gTqp4 hb6a51EafsCw5xqvoAbPqtXjIWt2SfQH//fKcNP9BIQIb4XJVV/fMuxnCku1gUl9dH+8Pb fYcyPzg0p3fGRV+Acw6W7WDi0X4XA/2puQc6fLDEEojnKLT4ZpMzJIDnpO3d5A== 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=1721047112; 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=5bplBUzSyPOsFzM0n5BPU3rvII1U5X9JvN975aJGUwc=; b=xkgt+yhDJH7m6P80Xz2FH6e+wUpRJ49JdAwEZY1+tGi5j7YqsIfQdUkMjnZC4Pz/lvdZWC pLp1tGy1xkhd+ZaD9QPDaQPNy2/i9JXJXCHjEysiaeFqAqgyl5SKCZLRPvWQFYBMJj7M8l 6rnMNZ4FNz7QK9MQIeOJ43Q2BzfoatClLyLF/tPJmTGrLK3tMmkVYdmhLD8LFvr/jhQkK5 nClXhJD+RWL7vzC7LwjNnL7jgSwbVCbBy0VUesgVE3niyBlwiMJb7sNen75qbCJwLBGIXo as/28LRUkj7lW/+4WMNNJ0S7NS1WPwTWpvGF6g2pPOPPhdAGsfo8LxVtKRRCrA== 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 4WN1vr68YHzspH; Mon, 15 Jul 2024 12:38:32 +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 46FCcWUX061875; Mon, 15 Jul 2024 12:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCcWAw061872; Mon, 15 Jul 2024 12:38:32 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:32 GMT Message-Id: <202407151238.46FCcWAw061872@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: 833ccd66dac6 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 833ccd66dac6d9888d542fa0cc52cfa482e314ba Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=833ccd66dac6d9888d542fa0cc52cfa482e314ba commit 833ccd66dac6d9888d542fa0cc52cfa482e314ba Author: Andrew Turner AuthorDate: 2024-06-12 13:04:13 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:28:45 +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 84411e8e4b16..19b7d8fe427d 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -218,6 +218,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)))