From d1f9db11b2016c3f66c230c5fbf6762b4a2984ab Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 15 Apr 2022 18:08:35 +0100 Subject: Enable lots of warnings, fix the few bits of fallout --- Jamroot.jam | 10 ++++++++++ netfs/daemon/daemon.cpp | 4 ++-- netfs/fuse/netfs.cpp | 7 ++++--- netfs/unittests/mockMount.cpp | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index c13f68c..c49440c 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -17,10 +17,20 @@ project release:on debug:extra debug:on + debug:-Wnon-virtual-dtor debug:-Wold-style-cast debug:-Wcast-align + debug:-Wunused + debug:-Woverloaded-virtual + debug:-Wpedantic debug:-Wconversion debug:-Wsign-conversion + debug:-Wnull-dereference + debug:-Wdouble-promotion + debug:-Wformat=2 + debug:-Wshadow + gcc,debug:-Wduplicated-cond + gcc,debug:-Wduplicated-branches gcc,debug:-Wlogical-op gcc,debug:-Wuseless-cast coverage:on diff --git a/netfs/daemon/daemon.cpp b/netfs/daemon/daemon.cpp index 4d245ac..831c409 100644 --- a/netfs/daemon/daemon.cpp +++ b/netfs/daemon/daemon.cpp @@ -32,9 +32,9 @@ NetFSDaemon::hostname() // name = NetFSDaemonAdapter void -NetFSDaemon::start(const std::string & name, const Ice::CommunicatorPtr & ic, const Ice::StringSeq &) +NetFSDaemon::start(const std::string & name, const Ice::CommunicatorPtr & c, const Ice::StringSeq &) { - this->ic = ic; + ic = c; Ice::PropertiesPtr props = ic->getProperties(); LoadConfiguration(props->getProperty("NetFSD.ConfigPath")); diff --git a/netfs/fuse/netfs.cpp b/netfs/fuse/netfs.cpp index 77530ac..92242d4 100644 --- a/netfs/fuse/netfs.cpp +++ b/netfs/fuse/netfs.cpp @@ -6,11 +6,11 @@ class FuseImpl : public fuse_args, public NetFS::FuseApp { public: FuseImpl(int c, char ** v) : fuse_args(FUSE_ARGS_INIT(c, v)), NetFS::FuseApp([this]() { - Ice::StringSeq iceArgs; - if (fuse_opt_parse(this, &iceArgs, nullptr, opt_parse) == -1) { + Ice::StringSeq rtn; + if (fuse_opt_parse(this, &rtn, nullptr, opt_parse) == -1) { exit(-1); } - return iceArgs; + return rtn; }()) { openlog("netfs", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER); @@ -38,6 +38,7 @@ public: void vlogf(int priority, const char * fmt, va_list args) const noexcept override { + // NOLINTNEXTLINE(clang-diagnostic-format-nonliteral) vsyslog(priority, fmt, args); } }; diff --git a/netfs/unittests/mockMount.cpp b/netfs/unittests/mockMount.cpp index 515d2cc..9195c1b 100644 --- a/netfs/unittests/mockMount.cpp +++ b/netfs/unittests/mockMount.cpp @@ -57,6 +57,7 @@ char * FuseMountPoint::vstrdupf(const char * fmt, va_list args) { char * out {}; + // NOLINTNEXTLINE(clang-diagnostic-format-nonliteral) BOOST_REQUIRE_GE(vasprintf(&out, fmt, args), 0); BOOST_REQUIRE(out); return out; -- cgit v1.2.3