examples/packet_ordering: fix format specifier for port ID
PATCH 1/2 examples/packet_ordering: fix format specifier for port ID
port_id is uint16_t, use PRIu16 instead of PRIu8 to fix format specifier mismatch warning with GCC 15.
../examples/packet_ordering/main.c: In function 'main':../examples/packet_ordering/main.c:740:46:
warning: format '%hhu' expects argument of type 'unsigned char', but argument 3 has type 'uint16_t' [-Wformat=]
740 | rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n",
| ^
--- examples/packet_ordering/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/packet_ordering/main.c +1 -1
@@ -737,7 +737,7 @@ main(int argc, char **argv)printf ("Initializing port %u... done\n" , port_id);if (configure_eth_port (port_id) !=0 ) -rte_exit (EXIT_FAILURE ,"Cannot initialize port %" PRIu8"\n" , +rte_exit (EXIT_FAILURE ,"Cannot initialize port %" PRIu16"\n" , port_id); }
Signature · 1 line
2.43.0
PATCH 2/2 examples/ptpclient: fix format specifier for port ID
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",
| ^
--- examples/ptpclient/ptpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/ptpclient/ptpclient.c +1 -1
@@ -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
Signature · 1 line
2.43.0
Re: [PATCH 2/2] examples/ptpclient: fix format specifier for port ID
Quoted 4 lines · Aarnav JP
portid is
uint16_t, use PRIu16 instead of PRIu8 to fix format specifier mismatch warning with GCC 15.
Quoted 8 lines
../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")
Same as previous comment, at the time this code was introduced, port_id was a uint8_t.
This can be fixed when applying:
Quoted 3 lines
Signed-off-by Aarnav JP <[email protected]>
Signature · 1 line
David Marchand
Re: [PATCH 2/2] examples/ptpclient: fix format specifier for port ID
Quoted 18 lines · David Marchand
Quoted 4 lines · Aarnav JP
portid is
uint16_t, use PRIu16 instead of PRIu8 to fix format specifier mismatch warning with GCC 15.Quoted 8 lines
../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")Same as previous comment, at the time this code was introduced,
port_idwas auint8_t.
Quoted 7 lines
This can be fixed when applying:
Fixes 47523597ff6c ("examples: fix port id type")Quoted 3 lines
Signed-off-by Aarnav JP <[email protected]>Reviewed-by David Marchand <[email protected]>
Series applied, thanks for the fixes.
Signature · 1 line
David Marchand
Hello,
Quoted 4 lines · Aarnav JP
port_idisuint16_t, use PRIu16 instead of PRIu8 to fix format specifier mismatch warning with GCC 15.
Quoted 8 lines
../examples/packet_ordering/main.c: In function 'main':../examples/packet_ordering/main.c:740:46:
warning: format '%hhu' expects argument of type 'unsigned char', but argument 3 has type 'uint16_t' [-Wformat=]
740 | rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n",
| ^Fixes 850f3733f840 ("examples/packet_ordering: new sample app")
At the time this code was introduced, port_id was a uint8_t.
This can be fixed when applying:
Quoted 3 lines
Signed-off-by Aarnav JP <[email protected]>
Signature · 1 line
David Marchand