Skip to content

Fix msvc warnings#60

Open
rdck wants to merge 1 commit intorxi:masterfrom
rdck:msvc-warnings
Open

Fix msvc warnings#60
rdck wants to merge 1 commit intorxi:masterfrom
rdck:msvc-warnings

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.

@awschult002
Copy link

there has been a new community fork of this repository. the community is looking to add some new simple features. please feel free to try your PR over there.

https://github.com/microui-community/microui

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.

3 participants