Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix msvc warnings #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix msvc warnings #60

wants to merge 1 commit into from

Conversation

rdck
Copy link

@rdck rdck commented Sep 12, 2022

The Microsoft C compiler at warning level 3 (/W3) complains about various integer casts. I assume microui doesn't intend to handle the cases where these casts would overflow. I think it's worth making the casts explicit, to express that this is the intended behavior.

@rilysh
Copy link

rilysh commented Jul 10, 2023

MSVC showing the integer casting warning message because microui uses the wrong type-casting for strlen. strlen on both 32-bit and 64-bit in x86 and amd64 returns an unsigned long but microui has unsigned as the type. See here.

There are other points I saw where microui uses that same wrong type for a specific purpose. MSVC explicitly sees microui as a C++ file thus it leads to explicit casting since C++ requires you to do so.

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