From nobody Fri Jun 19 18:14:51 2026 X-Original-To: dev-commits-src-branches@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 4ghm353B6Sz6jlpp for ; Fri, 19 Jun 2026 18:14:57 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghm351RCWz3gs0 for ; Fri, 19 Jun 2026 18:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781892897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4tVkURcZQsMpfj5v8F9xUTBRYqFFBY3Hm/58QvNvqJs=; b=R5uJsGIJndztD4CfHjFjBiSth0ZwF6ggBu+Rwz10NxVQuJELFkvo2gMnlfr8DfLFMfCT4x mjKkdK82Q6Yh11CDGyV0w9G/ISzKxdyvgg2dXEJOG2Zn7PpZGyC7GcKpZQpecYFaWQ7kBe EYzQ2hDnh3+pMtE5N78yR3tzcLFuHS/tOogsO2Gx/T7TYYG+RemG4YwnRXVcE8m4jLy+CH gAoD8uFie68JK5KmfCOtv06VTp8QwsXzzLnyDliNSuXqc+HRYon5mlNMfw7Ym9ArghmBJ0 K193Jprku5w9BMUza2dmfhT5p1wMCMewzianPnEjA6vYiCaman7JHDX0kUC+bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781892897; a=rsa-sha256; cv=none; b=mmcXXMuqvYr0R3a9FscoI9RtLZBPdn7RKB27rqSbBw+g11E//dQEkY39sM/+pvFt7/x10d BcXbKeD2OdMUDeFaLGLKYBff0X6FelmVLrjH28b5Dg7b2b99xTQt/DtBh0PJr+r4Y0CIhH t1xk1bcYcDIqaFMO2qeYu2pHLJaJE0B+FgOfRF53W92+8Rkv/LKguM622IbqKGvenGSSDu NlhK8mscrFxadu11vGSwdUoY9zQy8w4/RifjNjLayHUpo+I3o5P2i1HXSx8l1TcCh725Gw 4+16SUcdH6Lu5+Hr0++Itcuioe0BP4P9j+SxbnstbgXDg0oBqjd0E6gU68/NTA== 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=1781892897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4tVkURcZQsMpfj5v8F9xUTBRYqFFBY3Hm/58QvNvqJs=; b=Lh31dqfjMgcbpyGD+qnzA+8nKKd5rCMETCjHi0YCRFQcwrTzeA1Chs9g+DUofnmkkWSfx5 tWMWwN9vc2Y26KzxUwAiivqo1WQZjazyYLk0HuN8o5WXXNBOiv1kmdlX49LOW4BaMJ/PfM 6Dh8LrDgj7A4hiORhjhCLnxu2qE99vHe+SNcVTYboFOXcsBVRfQyCpGbAFHtkYbktZDP6F 1AIUMSaI7p65lL73rWsJkrpDbGPlBt1EXOiItOu4m3Px7n2O6RuXN7RsJhSc50P9tcBZ0S S8/NIpR9Fj2Loucr+MAUXCMTNqpTPDPrddFZVyq6QGjkD2zFGNqHDTGOL0kf+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghm346nwszwgv for ; Fri, 19 Jun 2026 18:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2650d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 18:14:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Hans Rosenfeld From: Ed Maste Subject: git: 2db353ea26c7 - stable/15 - sys/cdefs.h: Introduce __maybe_unused attribute List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2db353ea26c7532253ec468ffacaf2f72eda8fdd Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 18:14:51 +0000 Message-Id: <6a35871b.2650d.636a5232@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2db353ea26c7532253ec468ffacaf2f72eda8fdd commit 2db353ea26c7532253ec468ffacaf2f72eda8fdd Author: Hans Rosenfeld AuthorDate: 2026-04-16 18:22:44 +0000 Commit: Ed Maste CommitDate: 2026-06-19 18:13:53 +0000 sys/cdefs.h: Introduce __maybe_unused attribute The __maybe_unused attribute should be used for variables which may or may not be used, such as when their only use is in an assertion. This attribute is functionally identical to __unused, suppressing compiler warnings for particular variable if it remains unused. Reviewed by: Minsoo Choo , imp Differential Revision: https://reviews.freebsd.org/D56517 (cherry picked from commit 84a95741805d84f0074a34d61b93ccf86f422cf3) --- share/man/man9/cdefs.9 | 6 ++++-- sys/compat/linuxkpi/common/include/linux/compiler_attributes.h | 1 - sys/sys/cdefs.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index cc56e34d070a..2bda50c3f875 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 9, 2025 +.Dd May 6, 2026 .Dt CDEFS 9 .Os .Sh NAME @@ -85,7 +85,9 @@ linkage. .It Sy __weak_symbol Ta Declare the symbol to be a weak symbol .It Sy __dead2 Ta Function will not return .It Sy __pure2 Ta Function has no side effects -.It Sy __unused Ta To Variable may be unused (usually arguments), so do not +.It Sy __unused Ta Variable may be unused (usually arguments), so do not +warn about it +.It Sy __maybe_unused Ta Variable may be unused (usually arguments), so do not warn about it .It Sy __used Ta Function really is used, so emit it even if it appears unused. .It Sy __deprecated Ta Function interface has been deprecated, and clients diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h b/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h index 42908bb6c2b5..159c833802c5 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler_attributes.h @@ -39,7 +39,6 @@ #define noinline_for_stack __noinline -#define __maybe_unused __unused #define __always_unused __unused #define __must_check __result_use_check diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 916668a52fc0..d0a34f1bdfc0 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -146,6 +146,7 @@ #define __weak_symbol __attribute__((__weak__)) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) +#define __maybe_unused __attribute__((__unused__)) #define __unused __attribute__((__unused__)) #define __used __attribute__((__used__)) #define __deprecated __attribute__((__deprecated__))