[PATCH 2/2] examples/ptpclient: fix format specifier for port ID
Aarnav JP
ajp at marvell.com
Fri Mar 27 05:15:17 CET 2026
portid is uint16_t, use PRIu16 instead of PRIu8 to fix
format specifier mismatch warning with GCC 15.
../examples/ptpclient/ptpclient.c: In function 'main':
../examples/ptpclient/ptpclient.c:797:30:
warning: format '%hhu' expects argument of type 'unsigned char',
but argument 3 has type 'uint16_t' [-Wformat=]
797 | "Cannot init port %"PRIu8 "\n",
| ^
Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")
Cc: stable at dpdk.org
Signed-off-by: Aarnav JP <ajp at marvell.com>
---
examples/ptpclient/ptpclient.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index c344e7db1e..1fec4af767 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -794,7 +794,7 @@ main(int argc, char *argv[])
ptp_enabled_port_nb++;
} else {
rte_exit(EXIT_FAILURE,
- "Cannot init port %"PRIu8 "\n",
+ "Cannot init port %"PRIu16 "\n",
portid);
}
} else
--
2.43.0
More information about the dev
mailing list