edn-cpp icon indicating copy to clipboard operation
edn-cpp copied to clipboard

Avoid GCC-7 & above compiler warning: -Wimplicit-fallthrough

Open ellio167 opened this issue 5 years ago • 0 comments

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.

ellio167 avatar Jun 22 '19 02:06 ellio167