SFML/imgui-sfml

Unused values warnings

zpervan opened this issue · 1 comments

While building, warnings are shown which with the -Werror flag makes the project unbuildable.

Environment:

  • Compiler: clang++-10
  • SFML 2.5.1
  • imgui 1.88
  • imgui-SFML latest dev commit (May 25)

Verbose log output:

Starting local Bazel server and connecting to it...
INFO: Analyzed target //:map-editor (42 packages loaded, 397 targets configured).
INFO: Found 1 target...
INFO: From Compiling imgui-SFML.cpp:
external/imguilib/imgui-SFML.cpp: In function 'ImGuiKey ImGui::SFML::keycodeToImGuiKey(sf::Keyboard::Key)':
external/imguilib/imgui-SFML.cpp:326:12: warning: enumeration value 'Unknown' not handled in switch [-Wswitch]
  326 |     switch (code) {
      |            ^
external/imguilib/imgui-SFML.cpp:326:12: warning: enumeration value 'F13' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:326:12: warning: enumeration value 'F14' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:326:12: warning: enumeration value 'F15' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:326:12: warning: enumeration value 'KeyCount' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp: In function 'ImGuiKey ImGui::SFML::keycodeToImGuiMod(sf::Keyboard::Key)':
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Unknown' not handled in switch [-Wswitch]
  535 |     switch (code) {
      |            ^
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'A' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'B' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'C' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'D' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'E' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'G' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'H' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'I' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'J' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'K' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'L' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'M' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'N' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'O' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'P' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Q' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'R' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'S' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'T' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'U' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'V' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'W' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'X' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Y' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Z' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num0' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num1' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num2' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num3' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num4' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num5' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num6' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num7' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num8' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Num9' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Escape' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Menu' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'LBracket' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'RBracket' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Semicolon' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Comma' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Period' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Quote' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Slash' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Backslash' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Tilde' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Equal' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Hyphen' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Space' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Enter' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Backspace' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Tab' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'PageUp' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'PageDown' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'End' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Home' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Insert' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Delete' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Add' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Subtract' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Multiply' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Divide' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Left' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Right' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Up' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Down' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad0' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad1' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad2' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad3' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad4' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad5' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad6' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad7' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad8' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Numpad9' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F1' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F2' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F3' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F4' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F5' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F6' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F7' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F8' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F9' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F10' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F11' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F12' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F13' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F14' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'F15' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Pause' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'KeyCount' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Dash' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'BackSpace' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'BackSlash' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'SemiColon' not handled in switch [-Wswitch]
external/imguilib/imgui-SFML.cpp:535:12: warning: enumeration value 'Return' not handled in switch [-Wswitch]

The easiest solution would be to exclude the -Werror for clang for the imgui-SFML, but would be just a workaround in the end...

There is now a IMGUI_SFML_ENABLE_WARNINGS option that defaults to OFF which means you won't get -Werror or any other compiler warnings unless you explicitly opt into them. I hope that fixes your problem.