From fc0213d12c831132c62d3294fd237ed9a3ab37a2 Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Wed, 20 Mar 2024 13:32:01 +0100 Subject: [PATCH] fix compile error with gcc 13 The result of bit_width is an integer, and that can't be used with bit_ceil. Adds an extra cast to make sure the type is correct. Fixes #3. --- include/pareas/lpg/render_util.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pareas/lpg/render_util.hpp b/include/pareas/lpg/render_util.hpp index ead7f17..ee4273d 100644 --- a/include/pareas/lpg/render_util.hpp +++ b/include/pareas/lpg/render_util.hpp @@ -9,7 +9,7 @@ namespace pareas { template constexpr T int_bit_width(T x) { - auto width = std::max(T{8}, std::bit_ceil(std::bit_width(x))); + auto width = std::max(T{8}, std::bit_ceil(static_cast(std::bit_width(x)))); // This should only happen if there are a LOT of rules anyway. assert(width <= 64); return width;