-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
printf format specifiers are invalid for MinGW which causes misleading warnings #3592
Comments
Hello, |
|
Done some tests on my side and pushed a fix for it : 7a135a7 |
I would not use just |
Note: |
@ocornut are you sure that the linked commit is the right solution? IMO if there were no problems with |
…Rectangle. Fix Clang OSX warnings. Amend #3592 for Mingw only.
Tested with |
Version/Branch of Dear ImGui:
acb8ef2 (1.80 WIP (17905))
Back-end/Renderer/Compiler/OS
Back-ends: https://github.com/mosra/magnum-integration/tree/master/src/Magnum/ImGuiIntegration
Compiler: MinGW GCC 10.2.1
Operating System: Windows
My Issue/Question:
Dear ImGui creates misleading warnings that do not match compiler's behavior. ImGui is using incorrect format specifiers. The current ImGui macro (
#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1)))
) does not match MinGW's implementation.Standalone, minimal, complete and verifiable example: (see #2261)
The code above (compiled with
-Wall -Wextra -Wpedantic -std=c++17
) generates following warnings:The macro (whether commented or not) in the first line has no impact on warnings (at least in MinGW distribution I use). Warnings appear only for
printf
andms_printf
format specifiers but MinGW's actual implementation is:Thus, if I call printf-style functions from Dear ImGui in my project, I'm getting warnings that
%zu
is not supported while it actually is. I never get warnings for standardprintf
functions and they are used in ImGui's implementation. So in short, ImGui's functions are just incorrectly labeled.The text was updated successfully, but these errors were encountered: