The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a96eb797b2d4eab42b8d03935850532939df8fcc
commit a96eb797b2d4eab42b8d03935850532939df8fcc Author: Alex Richardson <[email protected]> AuthorDate: 2025-09-16 04:54:36 +0000 Commit: Dimitry Andric <[email protected]> CommitDate: 2026-01-04 01:46:55 +0000 sys/xen: Use __printflike() instead of format(printf) The __printflike macro sets the format to freebsd_kprintf which recent clang understands and warns about. Fixes the following error: `passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]` MFC after: 1 week (cherry picked from commit 4cd7be3e81863bd22aacccc34fc2e8b2cfcb14d9) --- sys/dev/xen/blkback/blkback.c | 2 +- sys/xen/xen_intr.h | 2 +- sys/xen/xenbus/xenbusvar.h | 8 ++++---- sys/xen/xenstore/xenstorevar.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index c58af5e9c90f..57dafd762e41 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -173,7 +173,7 @@ struct xbb_softc; struct xbb_xen_req; static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, - ...) __attribute__((format(printf, 3, 4))); + ...) __printflike(3, 4); static int xbb_shutdown(struct xbb_softc *xbb); /*------------------------------ Data Structures -----------------------------*/ diff --git a/sys/xen/xen_intr.h b/sys/xen/xen_intr.h index 57e1337398f4..25d676a15632 100644 --- a/sys/xen/xen_intr.h +++ b/sys/xen/xen_intr.h @@ -194,7 +194,7 @@ void xen_intr_unbind(xen_intr_handle_t *handle); */ int xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...) - __attribute__((format(printf, 2, 3))); + __printflike(2, 3); /** * Signal the remote peer of an interrupt source associated with an diff --git a/sys/xen/xenbus/xenbusvar.h b/sys/xen/xenbus/xenbusvar.h index 6cb6033bdca1..c332b261a62e 100644 --- a/sys/xen/xenbus/xenbusvar.h +++ b/sys/xen/xenbus/xenbusvar.h @@ -152,7 +152,7 @@ int xenbus_grant_ring(device_t dev, unsigned long ring_mfn, grant_ref_t *refp); * printf arguments. */ void xenbus_dev_error(device_t dev, int err, const char *fmt, ...) - __attribute__((format(printf, 3, 4))); + __printflike(3, 4); /** * va_list version of xenbus_dev_error(). @@ -163,7 +163,7 @@ void xenbus_dev_error(device_t dev, int err, const char *fmt, ...) * \param ap Va_list of printf arguments. */ void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap) - __attribute__((format(printf, 3, 0))); + __printflike(3, 0); /** * Equivalent to xenbus_dev_error(), followed by @@ -175,7 +175,7 @@ void xenbus_dev_verror(device_t dev, int err, const char *fmt, va_list ap) * printf arguments. */ void xenbus_dev_fatal(device_t dev, int err, const char *fmt, ...) - __attribute__((format(printf, 3, 4))); + __printflike(3, 4); /** * va_list version of xenbus_dev_fatal(). @@ -186,7 +186,7 @@ void xenbus_dev_fatal(device_t dev, int err, const char *fmt, ...) * \param ap Va_list of printf arguments. */ void xenbus_dev_vfatal(device_t dev, int err, const char *fmt, va_list) - __attribute__((format(printf, 3, 0))); + __printflike(3, 0); /** * Convert a member of the xenbus_state enum into an ASCII string. diff --git a/sys/xen/xenstore/xenstorevar.h b/sys/xen/xenstore/xenstorevar.h index 021b609d2f9c..89cfa0dda32f 100644 --- a/sys/xen/xenstore/xenstorevar.h +++ b/sys/xen/xenstore/xenstorevar.h @@ -271,7 +271,7 @@ int xs_scanf(struct xs_transaction t, */ int xs_printf(struct xs_transaction t, const char *dir, const char *node, const char *fmt, ...) - __attribute__((format(printf, 4, 5))); + __printflike(4, 5); /** * va_list version of xenbus_printf().
