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

Disable format checks when using stb_sprintf.h #2954

Conversation

loicmolinari
Copy link
Contributor

@loicmolinari loicmolinari commented Dec 29, 2019

STB sprintf allows extra formats like %b or %$d. If ImGui is configured
to use STB sprintf, it generates warnings with GCC and clang when using
such formats because it keeps applying default printf-style warnings.
This commit disables printf-style warnings when using STB sprintf.

Since the printf-style warnings are defined in imgui.h based on the
compiler, IMGUI_USE_STB_SPRINTF can't just be defined in the cpp file
anymore and it's been moved as a proper config in imconfig.h.

STB sprintf allows extra formats like %b or %$d. If ImGui is configured
to use STB sprintf, it generates warnings with GCC and clang when using
such formats because it keeps applying default printf-style warnings.
This commit disables printf-style warnings when using STB sprintf.

Since the printf-style warnings are defined in imgui.h based on the
compiler, IMGUI_USE_STB_SPRINTF can't just be defined in the cpp file
anymore and it's been moved as a proper config in imconfig.h.
@loicmolinari loicmolinari force-pushed the imgui-use-stb-sprintf-format-fix branch from 3e57da7 to 6d23bad Compare December 29, 2019 15:11
@ocornut
Copy link
Owner

ocornut commented Jan 17, 2020

This is merged now, thank you!
(squashed as 6c00d19)

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.

None yet

2 participants