edn-cpp
edn-cpp copied to clipboard
Avoid GCC-7 & above compiler warning: -Wimplicit-fallthrough
With current master and GCC 7 or above (GCC 9 in this specific example) I see:
$ g++-9 -Wextra example.cpp
In file included from example.cpp:2:
edn.hpp: In function 'std::string edn::escapeQuotes(const string&)':
edn.hpp:390:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
390 | after += '\\';
| ^~~~
edn.hpp:391:9: note: here
391 | default:
| ^~~~~~~
To avoid this, I've switched to an equivalent if()
statement.