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

Compilation warnings clean-up #40

Closed
Guillaume227 opened this issue Feb 6, 2023 · 3 comments
Closed

Compilation warnings clean-up #40

Guillaume227 opened this issue Feb 6, 2023 · 3 comments

Comments

@Guillaume227
Copy link
Contributor

I have noticed the following warnings when building on windows.
Absolutely not critical but I like to have a clean build, so would be nice to get rid of them.
Let me know if you would like a PR or just handle them on your end when time permits.

Commenting out the parameter name should do for those:

hello_imgui\hello_imgui_cmake\HelloImGui_WinMain.cpp(7): warning C4100: 'nCmdShow': unreferenced formal parameter
hello_imgui\hello_imgui_cmake\HelloImGui_WinMain.cpp(7): warning C4100: 'lpCmdLine': unreferenced formal parameter
hello_imgui\hello_imgui_cmake\HelloImGui_WinMain.cpp(7): warning C4100: 'hPrevInstance': unreferenced formal parameter
hello_imgui\hello_imgui_cmake\HelloImGui_WinMain.cpp(7): warning C4100: 'hInstance': unreferenced formal parameter
hello_imgui\internal\backend_impls\backend_window_helper\glfw_window_helper.cpp(14): warning C4100: 'backendOptions': unreferenced formal parameter

Not sure about that one:

hello_imgui\internal\backend_impls\backend_window_helper\glfw_window_helper.cpp(9): warning C4505: 'HelloImGui::BackendApi::glfw_error_callback': unreferenced function with internal linkage has been removed

That one is probably a release vs debug thing: the value is used by an assert macro that does not do anything in release.

hello_imgui\internal\backend_impls\runner_glfw_opengl3.cpp(42): warning C4189: 'glfwInitSuccess': local variable is initialized but not referenced

A static_cast should be ok for that one (although that's 3rd party code):

hello_imgui\src\hello_imgui\..\hello_imgui/internal/pnm.h(1046): warning C4267: 'argument': conversion from 'size_t' to 'const uint8_t', possible loss of data
@pthom
Copy link
Owner

pthom commented Feb 6, 2023

Hello,

Thanks for this. A PR would be perfect!
concerning the unused variable you can silence the warning with
`(void)varName;ˋ

@Guillaume227
Copy link
Contributor Author

What about the glfw_error_callback warning ? Seems like maybe we forgot to set that callback with glfwSetErrorCallback(glfw_error_callback); ? I am not sure where that statement should go though.

@pthom
Copy link
Owner

pthom commented Feb 7, 2023

What about the glfw_error_callback warning ? Seems like maybe we forgot to set that callback with glfwSetErrorCallback(glfw_error_callback); ? I am not sure where that statement should go though.

It is unused. I'll remove it.

@pthom pthom closed this as completed Feb 7, 2023
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

No branches or pull requests

2 participants