-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
All enum values not handled in switch cases. ( -Wswitch-enum ) #889
Comments
Seems to be a duplicate of #555. |
Yes . It is a duplicate of this issue. I guess it was rejected because not all enums were handled in switch cases and it still reported some warnings. I have added the enums in the switch cases and a default label too. |
Right - we need to decide whether we want to make Clang or GCC happy, because now we would have
all over the place. |
I do not like the idea add redundancies to the code to make GCC happy while adding a Clang warning at the same time. See #555 for a discussion. |
Bug Report
What is the issue you have?
I am having issues while compiling a C++ program using the json.hpp file. I am using the complier options -Wswitch-enum and -Werror. I see that all the enums are not handled in the switch cases, which is why I am seeing some errors while compiling.
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Include the json.hpp in the header of a c++ program and compile the program using -Wswitch-enum and -Werror options.
What is the expected behavior?
All enums must be handled and there should be no errors while using these compiler options.
And what is the actual behavior instead?
Actual behaviour: It throws the errors like "src/json.hpp:3005:9: error: enumeration value ‘end_array’ not handled in switch [-Werror=switch-enum]"
Which compiler and operating system are you using? Is it a supported compiler?
Im using a Ubuntu OS and using a supported compiler.
Did you use a released version of the library or the version from the
develop
branch?Used from 'develop' branch.
If you experience a compilation error: can you compile and run the unit tests?
Not experiencing any issues with the existing compiler options. Errors only when using -Wswitch-enum and -Werror.
Feature Request
Describe the feature in as much detail as possible.
Include sample usage where appropriate.
The text was updated successfully, but these errors were encountered: