yaml-cpp
yaml-cpp copied to clipboard
-Wold-style-cast warning in convert.h
This commit: https://github.com/jbeder/yaml-cpp/commit/a6bbe0e50ac4074f0b9b44188c28cf00caf1a723 added a c style cast, I guess to silence a warning in MSVC. However with gcc/clang and -Wold-style-cast, it produces a warning:
yaml-cpp/node/convert.h:130:13: warning: use of old-style cast [-Wold-style-cast]
rhs = (T)num;
^ ~~~
1 warning generated.
Since T is either signed char on unsigned char here, it should be safe to change it to static_cast<T>(num) or T(num) here.