Closed Ar5ham closed 6 years ago
That's not good!
I'm not immediately ready to reproduce this, but thanks for including the project. I'll have to look at it after some delay :/
That is fine. Please let me know if you need any more info.
For some reason, the warning is off by default, see here. You need to add something like
#pragma warning(1 : 4062)
to enable it.
It seems that this can only be done by the user, so the code proper of Better Enums doesn't need to be modified.
However, we should probably document enabling this warning, perhaps by adding a short sentence and the link given by @JaapAap, to the tutorial and/or reference.
Yes, please document this issue. I spent 15 minutes trying to get this to fail, then I was about to complain about it and apparently it's a known issue! Imho either change the introduction page to mention that it needs enabling for all those people who are sadly on Visual Studio compilers, or remove the mentioning of the feature. Same for the tutorial page on the switch.
Enabling that feature is not always an option either, just FYI. Our project uses shared Libs and public headers and when I enabled the feature I also got warning related to Libs and headers that was not ours to begin with. I have picked up a work item to go take a look at how difficult it would be to fix all of them but I suspect it will be a time consuming effort.
Thanks for pinging. I updated the README and the switch
tutorial page with notes about enabling warning C4062 on msvc. I hope that's enough, please let me know/PR if more warnings are needed.
That's great, thanks Aantron. It's indeed enough.
Copy pasting the SafeSwitch example to project created via Visual Studio 2017 and compiling the project, no warning is being produced by the compiler.
Compiler Version:
Sample project: BetterEnumTest.zip