tgockel / json-voorhees

A killer modern C++ library for interacting with JSON.
http://tgockel.github.io/json-voorhees/
Apache License 2.0
128 stars 18 forks source link

Compiler Warning on Case Fallthrough in util.cpp #82

Closed tgockel closed 6 years ago

tgockel commented 6 years ago

g++ 7 and beyond gives the following warning about fallthrough on a switch:

/usr/sbin/c++  -DJSONV_CHAR_CONVERT_USE_BOOST_LOCALE=0 -DJSONV_TEST_DATA_DIR=\"//root/jsonv/src/jsonv-tests/data\" -Djsonv_EXPORTS -I//root/jsonv/include -I//root/jsonv/src  --std=c++14 -pedantic -Wall -Wextra -g   -ggdb -DJSONV_DEBUG=1 -fPIC   -o CMakeFiles/jsonv.dir/src/jsonv/util.cpp.o -c //root/jsonv/src/jsonv/util.cpp
//root/jsonv/src/jsonv/util.cpp: In function 'jsonv::value jsonv::merge_explicit(const jsonv::merge_rules&, jsonv::path, jsonv::value, jsonv::value)':
//root/jsonv/src/jsonv/util.cpp:118:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             if (b.kind() == kind::integer)
             ^~
//root/jsonv/src/jsonv/util.cpp:121:9: note: here
         case kind::decimal:

This is intentional, as the compiler-omitted line is:

            // fall through to decimal handler if b is a decimal