Closed JohelEGP closed 11 months ago
Could you explain how you're getting these warnings? I could not observe them no matter what I tried, for example:
$ clang++ -Werror -Wall -Wextra -I. -I../sfml/include -I../cimgui/imgui examples/minimal/main.cpp imgui-SFML.cpp -c
$ CC=clang CXX=clang++ cmake -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra" . -DIMGUI_DIR=../imgui -DSFML_DIR=../sfml && cmake --build .
-- Found SFML 2.6.0 in ../sfml
-- Found ImGui v1.89.8 WIP in ../imgui
$ clang++ --version
clang version 15.0.7
Target: x86_64-pc-linux-gnu
It's probably -Wconversion
.
Ah yes thanks. Needed both -Wconversion -Wsign-conversion
Hm I think the float conversion ones are totally harmless. Up to 224, float
covers int
. And it's not like making these places explicit gives us any insights.
Perhaps fixing and enforcing -Wsign-conversion
is a good goal, but indeed how to actually enforce them?
I'm using Clang 17, and my command lines don't have -Wsign-conversion
.
So I'm guessing its effects were integrated into -Wconversion
.
Perhaps fixing and enforcing
-Wsign-conversion
is a good goal, but indeed how to actually enforce them?
The way I went about it was doing what others did: https://github.com/search?q=repo%3ASFML%2Fimgui-sfml+warnings&type=pullrequests.
Coincidentally I also have a compiler warning related PR but this time I'm actually adding the warnings to the build script so we don't regress with compiler warnings. See #246.
https://github.com/SFML/imgui-sfml/commit/92dd79ccd426858787fe4384fa24892fba3dfac5
I started fixing these conversion warnings. MSVC caught a few to begin with.
Previously: