From 58c185b634d229a8d9896c4d9c7b553126b776f2 Mon Sep 17 00:00:00 2001 From: Vinay Yadav Date: Sat, 19 Oct 2024 19:29:21 +0530 Subject: [PATCH] Changing type of data_ to size_t to avoid compilation warnings (#4200) Changing type data_ to size_t because 1. If lib is cross-compiled for win32 using MXE environment it cause compilation warning -Wconversion on line 730 as sizeof(unsigned long) = 4 and sizeof(size_t) = 8 2. When lib is compiled on Unix like compiler generate warning -Wuseless-cast if static_cast is used to fix issue in 1 --- 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 21444176..daf7e3fe 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] = {' '};