KEMBAR78
Fix unwanted char promotion in decimal writer with wchar_t by Mishura4 · Pull Request #4483 · fmtlib/fmt · GitHub
Skip to content

Conversation

@Mishura4
Copy link
Contributor

@Mishura4 Mishura4 commented Jun 30, 2025

In

  it = write_significand(it, dec.significand, significand_size, 1,
                         has_decimal_point ? '.' : Char());

'.' being a prvalue of type char, Char being wchar_t, the result of the ternary is int, leading to write_significand taking on Char=int, leading to a conversion warning down the line with strict warning settings (i.e. /W4 on MSVC).

MSVC warning (relevant line is 67)

@vitaut
Copy link
Contributor

vitaut commented Jul 1, 2025

Thanks for the PR. In general we don't care about /W4 warnings since those are mostly noise but this change is simple enough, so I'm OK merging it.

@vitaut vitaut merged commit 27c5aab into fmtlib:master Jul 1, 2025
41 checks passed
@Mishura4
Copy link
Contributor Author

Mishura4 commented Jul 1, 2025

You might be thinking of /Wall 🤔which is MSVC's -Weverything

/W4 on msvc is mostly equivalent to -Wall -Wextra -Wconversion on clang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants