From 7cc38b5d65cd33bbe6dbc42a14388dd96ea6d21e Mon Sep 17 00:00:00 2001 From: vinayyadav3016 Date: Tue, 5 Sep 2023 12:05:12 +0530 Subject: [PATCH 1/3] Remove type cast as mxe(mingw32) compiler complains about useless-cast when FMT_PEDANTIC && FMT_WERROR options are enabled """ error: useless cast to type 'class fmt::v10::basic_format_args >' [-Werror=useless-cast] 1449 | basic_format_args>(args)); """ --- include/fmt/format-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index dac2d437a41a..d0c60494c0fa 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1446,7 +1446,7 @@ FMT_FUNC bool write_console(std::FILE* f, string_view text) { FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args args) { auto buffer = memory_buffer(); detail::vformat_to(buffer, fmt, - basic_format_args>(args)); + args); fwrite_fully(buffer.data(), 1, buffer.size(), f); } #endif From 5b12be27ed929006aaaabc35414c1d119e55190a Mon Sep 17 00:00:00 2001 From: vinayyadav3016 Date: Tue, 5 Sep 2023 19:20:59 +0530 Subject: [PATCH 2/3] Moved 'args' to previous line as requested --- include/fmt/format-inl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index d0c60494c0fa..553e7ce88d4b 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1445,8 +1445,7 @@ FMT_FUNC bool write_console(std::FILE* f, string_view text) { // Print assuming legacy (non-Unicode) encoding. FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args args) { auto buffer = memory_buffer(); - detail::vformat_to(buffer, fmt, - args); + detail::vformat_to(buffer, fmt, args); fwrite_fully(buffer.data(), 1, buffer.size(), f); } #endif From 7937ff90b2e4368ec61b10075980704d9990ad1e Mon Sep 17 00:00:00 2001 From: vinayyadav3016 Date: Tue, 15 Oct 2024 07:50:27 +0530 Subject: [PATCH 3/3] mingw32 cause compilation failure when -Wconversion is enabled while cross compiling for win32 application using MXE environment because long unsigned int != size_t (aka long long unsigned int) --- include/fmt/base.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 2144417673bf..f52dcb578bd2 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -727,7 +727,8 @@ class basic_specs { char fill_data_[max_fill_size] = {' '}; FMT_CONSTEXPR void set_fill_size(size_t size) { - data_ = (data_ & ~fill_size_mask) | (size << fill_size_shift); + data_ = static_cast((data_ & ~fill_size_mask) | + (size << fill_size_shift)); } public: