From e92c2d9866f4b561f50428c89943dadf50ea385e Mon Sep 17 00:00:00 2001 From: vinayyadav3016 Date: Tue, 15 Oct 2024 09:17:17 +0530 Subject: [PATCH] Changing type data_ to size_t which is more of concrete type because 1. If lib is cross-compiled for win32 using MXE environment it cause compilation error -Wconversion on line 730 as sizeof(unsigned long) = 4 and sizeof(size_t) = 8 2. When lib is compiled on Unix like compiler generate error -Wuseless-cast if static_cast is used to fix issue in 1 Futher if size_t is not concrete type then, type data_ can be changed to uint64_t or uint32_t because those have same sizes across all platforms --- include/fmt/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 2144417673bf..daf7e3fed29d 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -721,7 +721,7 @@ class basic_specs { max_fill_size = 4 }; - unsigned long data_ = 1 << fill_size_shift; + size_t data_ = 1 << fill_size_shift; // Character (code unit) type is erased to prevent template bloat. char fill_data_[max_fill_size] = {' '};