The branch main has been updated by dim:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4cd7be3e81863bd22aacccc34fc2e8b2cfcb14d9

commit 4cd7be3e81863bd22aacccc34fc2e8b2cfcb14d9
Author:     Alex Richardson <[email protected]>
AuthorDate: 2025-09-16 04:54:36 +0000
Commit:     Dimitry Andric <[email protected]>
CommitDate: 2025-12-28 21:16:40 +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
---
 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 c6cba729b991..dcfdcafa9351 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -152,7 +152,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 75c3dc7c6060..4965928cc8b4 100644
--- a/sys/xen/xen_intr.h
+++ b/sys/xen/xen_intr.h
@@ -182,7 +182,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 ee444c132c0c..0f4168f17e6a 100644
--- a/sys/xen/xenbus/xenbusvar.h
+++ b/sys/xen/xenbus/xenbusvar.h
@@ -151,7 +151,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().
@@ -162,7 +162,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
@@ -174,7 +174,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().
@@ -185,7 +185,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 8b02262396e8..f34ad375bc3a 100644
--- a/sys/xen/xenstore/xenstorevar.h
+++ b/sys/xen/xenstore/xenstorevar.h
@@ -270,7 +270,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().

Reply via email to