Skip to content
Snippets Groups Projects
Commit 17f96b83 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

More linux warning removals

parent ffbed97a
No related branches found
No related tags found
No related merge requests found
Pipeline #11206 failed
...@@ -125,7 +125,7 @@ check_include_file_cxx("opencv2/cudastereo.hpp" HAVE_OPENCVCUDA) ...@@ -125,7 +125,7 @@ check_include_file_cxx("opencv2/cudastereo.hpp" HAVE_OPENCVCUDA)
find_program(CPPCHECK_FOUND cppcheck) find_program(CPPCHECK_FOUND cppcheck)
if (CPPCHECK_FOUND) if (CPPCHECK_FOUND)
message(STATUS "Found cppcheck: will perform source checks") message(STATUS "Found cppcheck: will perform source checks")
set(CMAKE_CXX_CPPCHECK "cppcheck" "--enable=style" "--suppress=*:*catch.hpp" "--suppress=*:*elas*" "--suppress=*:*json.hpp") set(CMAKE_CXX_CPPCHECK "cppcheck" "--enable=warning,performance,portability,style" "--inline-suppr" "--std=c++11" "--suppress=*:*catch.hpp" "--suppress=*:*elas*" "--suppress=*:*json.hpp" "--quiet")
endif() endif()
# include_directories(${PROJECT_SOURCE_DIR}/common/cpp/include) # include_directories(${PROJECT_SOURCE_DIR}/common/cpp/include)
......
...@@ -536,7 +536,7 @@ namespace loguru ...@@ -536,7 +536,7 @@ namespace loguru
class LOGURU_EXPORT LogScopeRAII class LOGURU_EXPORT LogScopeRAII
{ {
public: public:
LogScopeRAII() : _file(nullptr) {} // No logging LogScopeRAII() : _file(nullptr), _line(0), _indent_stderr(false), _start_time_ns(0), _name({}) {} // No logging
LogScopeRAII(Verbosity verbosity, const char* file, unsigned line, LOGURU_FORMAT_STRING_TYPE format, ...) LOGURU_PRINTF_LIKE(5, 6); LogScopeRAII(Verbosity verbosity, const char* file, unsigned line, LOGURU_FORMAT_STRING_TYPE format, ...) LOGURU_PRINTF_LIKE(5, 6);
~LogScopeRAII(); ~LogScopeRAII();
......
...@@ -143,6 +143,7 @@ static bool mergeConfig(const string path) { ...@@ -143,6 +143,7 @@ static bool mergeConfig(const string path) {
} catch (...) { } catch (...) {
LOG(ERROR) << "Unknown error opening config file"; LOG(ERROR) << "Unknown error opening config file";
} }
return false;
} else { } else {
return false; return false;
} }
......
...@@ -510,6 +510,7 @@ namespace loguru ...@@ -510,6 +510,7 @@ namespace loguru
Text errno_as_text() Text errno_as_text()
{ {
// cppcheck-suppress unusedVariable
char buff[256]; char buff[256];
#if defined(__GLIBC__) && defined(_GNU_SOURCE) #if defined(__GLIBC__) && defined(_GNU_SOURCE)
// GNU Version // GNU Version
...@@ -1069,7 +1070,7 @@ namespace loguru ...@@ -1069,7 +1070,7 @@ namespace loguru
i - skip, int(2 + sizeof(void*) * 2), callstack[i], i - skip, int(2 + sizeof(void*) * 2), callstack[i],
status == 0 ? demangled : status == 0 ? demangled :
info.dli_sname == 0 ? symbols[i] : info.dli_sname, info.dli_sname == 0 ? symbols[i] : info.dli_sname,
static_cast<char*>(callstack[i]) - static_cast<char*>(info.dli_saddr)); (ssize_t)(static_cast<char*>(callstack[i]) - static_cast<char*>(info.dli_saddr)));
free(demangled); free(demangled);
} else { } else {
snprintf(buf, sizeof(buf), "%-3d %*p %s\n", snprintf(buf, sizeof(buf), "%-3d %*p %s\n",
......
...@@ -269,6 +269,7 @@ R Peer::call(const std::string &name, ARGS... args) { ...@@ -269,6 +269,7 @@ R Peer::call(const std::string &name, ARGS... args) {
template <typename T, typename... ARGS> template <typename T, typename... ARGS>
int Peer::asyncCall( int Peer::asyncCall(
const std::string &name, const std::string &name,
// cppcheck-suppress *
std::function<void(const T&)> cb, std::function<void(const T&)> cb,
ARGS... args) { ARGS... args) {
auto args_obj = std::make_tuple(args...); auto args_obj = std::make_tuple(args...);
......
...@@ -238,8 +238,8 @@ TEST_CASE("Peer::call()", "[rpc]") { ...@@ -238,8 +238,8 @@ TEST_CASE("Peer::call()", "[rpc]") {
std::thread thr([&s]() { std::thread thr([&s]() {
while (fakedata[0].size() == 0) std::this_thread::sleep_for(std::chrono::milliseconds(20)); while (fakedata[0].size() == 0) std::this_thread::sleep_for(std::chrono::milliseconds(20));
auto [id,value] = readRPC<tuple<>>(0); auto res = readRPC<tuple<>>(0);
auto res_obj = std::make_tuple(1,id,"__return__",77); auto res_obj = std::make_tuple(1,std::get<0>(res),"__return__",77);
std::stringstream buf; std::stringstream buf;
msgpack::pack(buf, res_obj); msgpack::pack(buf, res_obj);
fakedata[0] = buf.str(); fakedata[0] = buf.str();
...@@ -263,9 +263,9 @@ TEST_CASE("Peer::call()", "[rpc]") { ...@@ -263,9 +263,9 @@ TEST_CASE("Peer::call()", "[rpc]") {
std::thread thr([&s]() { std::thread thr([&s]() {
while (fakedata[0].size() == 0) std::this_thread::sleep_for(std::chrono::milliseconds(20)); while (fakedata[0].size() == 0) std::this_thread::sleep_for(std::chrono::milliseconds(20));
auto [id,value] = readRPC<tuple<>>(0); auto res = readRPC<tuple<>>(0);
vector<int> data = {44,55,66}; vector<int> data = {44,55,66};
auto res_obj = std::make_tuple(1,id,"__return__",data); auto res_obj = std::make_tuple(1,std::get<0>(res),"__return__",data);
std::stringstream buf; std::stringstream buf;
msgpack::pack(buf, res_obj); msgpack::pack(buf, res_obj);
fakedata[0] = buf.str(); fakedata[0] = buf.str();
......
...@@ -19,7 +19,7 @@ namespace rgbd { ...@@ -19,7 +19,7 @@ namespace rgbd {
*/ */
class RGBDSource : public ftl::Configurable { class RGBDSource : public ftl::Configurable {
public: public:
RGBDSource(nlohmann::json &config); explicit RGBDSource(nlohmann::json &config);
RGBDSource(nlohmann::json &config, ftl::net::Universe *net); RGBDSource(nlohmann::json &config, ftl::net::Universe *net);
virtual ~RGBDSource(); virtual ~RGBDSource();
...@@ -57,6 +57,7 @@ class RGBDSource : public ftl::Configurable { ...@@ -57,6 +57,7 @@ class RGBDSource : public ftl::Configurable {
*/ */
class Register { class Register {
public: public:
// cppcheck-suppress *
Register(const std::string &n, std::function<RGBDSource*(nlohmann::json&,ftl::net::Universe*)> f) { Register(const std::string &n, std::function<RGBDSource*(nlohmann::json&,ftl::net::Universe*)> f) {
RGBDSource::_register(n,f); RGBDSource::_register(n,f);
}; };
......
...@@ -37,6 +37,7 @@ class Disparity : public ftl::Configurable { ...@@ -37,6 +37,7 @@ class Disparity : public ftl::Configurable {
*/ */
class Register { class Register {
public: public:
// cppcheck-suppress *
Register(const std::string &n, std::function<Disparity*(ftl::Configurable *, const std::string &)> f) { Register(const std::string &n, std::function<Disparity*(ftl::Configurable *, const std::string &)> f) {
Disparity::_register(n,f); Disparity::_register(n,f);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment