-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Suppressed MSVC++ warning C5054 #2983
Conversation
warning C5054: operator '|': deprecated between enumerations of different types
Hmm, this is going to get really annoying quickly, if we can't inherit enums this is forcing either a lot of casts either putting the private enums in the public space. I suspect it may be easier to disable at least for our codebase (and still can be useful for user's codebase..) Installing Visual Studio 2019 now. |
I can't reproduce the warning with VS2019 (16.4.3) with |
Warning might come from a fact that This will indeed snowball quick. Maybe better idea would be to hold off until migration to C++11. Then we can have typesafe enums. Another slightly related detail: some tools advice to not use bitwise operations with ints. It would make sense if flag base time was |
I compile ImGui to a static library with the following command line arguments:
and only get a single (i.e. no snowball effect so far) C5054. According to the docs, the combination of /W4 and /std:c++latest triggers the warning. More info can be found at: https://docs.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=vs-2019#binary-expressions-with-different-enum-types. P.S.: As a general unrelated note: it is safer to use |
I was aiming to do that when switching to C++11 (probably soon in 2020), but you are right we should be able to do it now. I have a stash for it, I'll see if it gets me any warning on some platform.. Ignoring warning C5054 for now via 2478dbf as this is bound to happen in many other places even we luckied out now with only one. Thansk for the report! Unfortunately MSVC doesn't seem to have a |
warning C5054: operator '|': deprecated between enumerations of different types