From 6095cfd8fbd75fd65693be5dd4a1e37f9e2f8249 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 9 Jan 2023 12:45:22 +1030 Subject: [PATCH] version: fix version() function. ``` /home/rusty/devel/cvs/ccan/ccan/version/test/run.c:/home/rusty/devel/cvs/ccan/ccan/version/version.h:58:35: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int' ``` --- ccan/version/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/version/version.h b/ccan/version/version.h index 8820f174..9e805a3a 100644 --- a/ccan/version/version.h +++ b/ccan/version/version.h @@ -55,7 +55,7 @@ static inline uint16_t version_minor(const struct version v) { */ static inline struct version version(uint16_t major, uint16_t minor) { - struct version v = { ._v = major << 16 | minor }; + struct version v = { ._v = (uint32_t)major << 16 | minor }; return v; } -- 2.39.2