Skip to content

Commit ca34769

Browse files
tpamborkartben
authored andcommitted
net: shell: quic: Fix -Wformat warning on 64-bit platforms
Use the PRIu64 macro from inttypes.h to format the stream ID, which is of type uint64_t. This change resolves the -Wformat warning on 64-bit platforms: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'uint64_t' {aka 'long unsigned int'} Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
1 parent bdf4078 commit ca34769

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

subsys/net/lib/shell/quic_shell.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ LOG_MODULE_DECLARE(net_shell);
1212

1313
#include "net_shell_private.h"
1414

15+
#include <inttypes.h>
16+
1517
#if defined(CONFIG_QUIC_SHELL)
1618

1719
#include <zephyr/net/quic.h>
@@ -84,7 +86,7 @@ static void quic_stream_cb(struct quic_stream *stream, void *user_data)
8486
if (stream->id == QUIC_STREAM_ID_UNASSIGNED) {
8587
snprintk(id_str, sizeof(id_str), "<waiting connection>");
8688
} else {
87-
snprintk(id_str, sizeof(id_str), "%llu", stream->id);
89+
snprintk(id_str, sizeof(id_str), "%" PRIu64, stream->id);
8890
}
8991

9092
PR("[%2d] %d %-2d %-2d %-4d %-4s %s\t %s\n",
@@ -166,7 +168,7 @@ static void quic_context_stream_cb(struct quic_stream *stream, void *user_data)
166168
if (stream->id == QUIC_STREAM_ID_UNASSIGNED) {
167169
snprintk(id_str, sizeof(id_str), "<waiting connection>");
168170
} else {
169-
snprintk(id_str, sizeof(id_str), "%llu", stream->id);
171+
snprintk(id_str, sizeof(id_str), "%" PRIu64, stream->id);
170172
}
171173

172174
PR(" [%2d] %d %-4d %-4s %s\t %s\n",

0 commit comments

Comments
 (0)