Skip to content

Fix MSVC C4244 warning in utf8proc_charwidth_ambiguous() - #346

Merged
stevengj merged 1 commit into
JuliaStrings:masterfrom
deniskovalchuk:fix-msvc-C4244
Jul 22, 2026
Merged

Fix MSVC C4244 warning in utf8proc_charwidth_ambiguous()#346
stevengj merged 1 commit into
JuliaStrings:masterfrom
deniskovalchuk:fix-msvc-C4244

Conversation

@deniskovalchuk

@deniskovalchuk deniskovalchuk commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Hi!

Fixes #286: building with MSVC produces the following warning [1]:

warning C4244: 'return': conversion from 'const unsigned int' to 'utf8proc_bool', possible loss of data

There is no actual loss of data in this case. This change adds an explicit cast to utf8proc_bool to fix the warning.

[1] https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-3-and-4-c4244

Building with MSVC produces the following warning:

warning C4244: 'return': conversion from 'const unsigned int' to 'utf8proc_bool', possible loss of data

In this case, there is no actual loss of data. Add an explicit cast to utf8proc_bool to fix the warning.
@stevengj
stevengj merged commit 0075ed7 into JuliaStrings:master Jul 22, 2026
12 checks passed
@deniskovalchuk
deniskovalchuk deleted the fix-msvc-C4244 branch July 22, 2026 15:05
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.

warning C4244 in newly added function 'utf8proc_charwidth_ambiguous' when updating to 2.10

2 participants