Date: Fri, 6 Dec 2024 22:29:19 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6da04bcff9ef - main - cdefs: Add __deprecated1 which accepts a message as an argument Message-ID: <202412062229.4B6MTJ0d072312@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6da04bcff9efedeae7d4046553002b9e3b2bc24f commit 6da04bcff9efedeae7d4046553002b9e3b2bc24f Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-12-06 22:26:27 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-12-06 22:26:46 +0000 cdefs: Add __deprecated1 which accepts a message as an argument This message will be included in any warning issued by the compiler for use of the deprecated function. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47701 --- share/man/man9/cdefs.9 | 7 ++++++- sys/sys/cdefs.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index 0edd6e8392ca..b9821c70f2a1 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd November 20, 2024 +.Dd December 6, 2024 .Dt CDEFS 9 .Os .Sh NAME @@ -91,6 +91,11 @@ warn about it .It Sy __deprecated Ta Function interface has been deprecated, and clients should migrate to a new interface. A warning will be issued for clients of this interface. +.It Sy __deprecated1(msg) Ta Function interface has been deprecated, and clients +should migrate to a new interface. +The string +.Fa msg +will be included in a warning issued for clients of this interface. .It Sy __packed Ta \&Do not have space between structure elements for natural alignment. Used when communicating with external protocols. .It Sy __aligned(x) Ta Specify in bytes the minimum alignment for the specified field, structure or variable diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 4f4f09a3d763..c46be9f35842 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -155,6 +155,7 @@ #define __unused __attribute__((__unused__)) #define __used __attribute__((__used__)) #define __deprecated __attribute__((__deprecated__)) +#define __deprecated1(msg) __attribute__((__deprecated__(msg))) #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x)))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412062229.4B6MTJ0d072312>