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

Clang warning because ImGuiButtonFlags is defined twice #166

Closed
floooh opened this issue Nov 18, 2020 · 2 comments
Closed

Clang warning because ImGuiButtonFlags is defined twice #166

floooh opened this issue Nov 18, 2020 · 2 comments

Comments

@floooh
Copy link

floooh commented Nov 18, 2020

After updating from 1.77 to 1.79 I'm seeing the following warning in Xcode:

...cimgui/cimgui.h:201:13: warning: redefinition of typedef 'ImGuiButtonFlags' is a C11 feature [-Wtypedef-redefinition]
typedef int ImGuiButtonFlags;
            ^
...cimgui/cimgui.h:143:13: note: previous definition is here
typedef int ImGuiButtonFlags;

First definition is here:

cimgui/cimgui.h

Line 143 in ee5534d

typedef int ImGuiButtonFlags;

Second is here:

cimgui/cimgui.h

Line 201 in ee5534d

typedef int ImGuiButtonFlags;

I guess the reason is that ImGui now has this typedef in two different headers:

First in imgui_internal.h here:

https://github.com/ocornut/imgui/blob/71cc636696bd17c81514da49707e909958c14632/imgui_internal.h#L120

...and again in imgui.h here:

https://github.com/ocornut/imgui/blob/71cc636696bd17c81514da49707e909958c14632/imgui.h#L159

In ImGui 1.77, only imgui_internal.h had this definition, but not in imgui.h:

https://github.com/ocornut/imgui/blob/9418dcb69355558f70de260483424412c5ca2fce/imgui_internal.h#L115

(cc @ocornut, maybe this is an oversight in the original ImGui headers? It looks like ImGuiButtonFlags was originally a private type, but is now part of the public API, so it was added to imgui.h, but not removed from imgui_internal.h?)

@ocornut
Copy link

ocornut commented Nov 18, 2020

(cc @ocornut, maybe this is an oversight in the original ImGui headers?

Correct. I have now pushed a fix in imgui/master. Thanks for the heads up !

@sonoro1234
Copy link
Contributor

It will be incorporated when binding to 1.80

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

3 participants