windytan / redsea

Command-line FM-RDS decoder with JSON output.
MIT License
390 stars 36 forks source link

Warnings from jsoncpp #109

Closed windytan closed 2 months ago

windytan commented 2 months ago

Compiling on debian (gcc 12.2.0) and windows/msys2 (gcc 14.1.0) emits warnings about uninitialized variables in Json::Value::swapPayload():

In function 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = Json::Value::ValueHolder]',
    inlined from 'void Json::Value::swapPayload(Json::Value&)' at ../ext/json/jsoncpp.cpp:2874:12,
    inlined from 'bool Json::Reader::readValue()' at ../ext/json/jsoncpp.cpp:436:31:
D:/a/_temp/msys64/mingw64/include/c++/14.1.0/bits/move.h:222:7: warning: 'v.Json::Value::value_' may be used uninitialized [-Wmaybe-uninitialized]
  222 |       __a = _GLIBCXX_MOVE(__b);
      |       ^~~

Coverity Scan flags the same as a high-impact defect.