From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 8420C5A027D; Thu, 30 Nov 2023 11:07:26 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v2 2/3] packet: Offset plus length is not always uint32_t, but it's always size_t Date: Thu, 30 Nov 2023 11:07:25 +0100 Message-Id: <20231130100726.4151850-3-sbrivio@redhat.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130100726.4151850-1-sbrivio@redhat.com> References: <20231130100726.4151850-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: JY5UVI33ZD5EP5KDHWOKRS4ICNDPU3KW X-Message-ID-Hash: JY5UVI33ZD5EP5KDHWOKRS4ICNDPU3KW X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , lemmi@nerd2nerd.org X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit. Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t. Signed-off-by: Stefano Brivio --- packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packet.c b/packet.c index 12ac76b..ccfc846 100644 --- a/packet.c +++ b/packet.c @@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset, if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %zu, " + trace("packet offset plus length %zu from size %zu, " "%s:%i", p->pkt[idx].offset + len + offset, p->buf_size, func, line); } -- 2.39.2