summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-04-15 18:08:35 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-04-15 18:08:35 +0100
commitd1f9db11b2016c3f66c230c5fbf6762b4a2984ab (patch)
treed10a8d84240d09f522e814170cdd88a23bc6aa05
parentNo hacky define, types for open maps public for testing (diff)
downloadnetfs-d1f9db11b2016c3f66c230c5fbf6762b4a2984ab.tar.bz2
netfs-d1f9db11b2016c3f66c230c5fbf6762b4a2984ab.tar.xz
netfs-d1f9db11b2016c3f66c230c5fbf6762b4a2984ab.zip
Enable lots of warnings, fix the few bits of fallout
-rw-r--r--Jamroot.jam10
-rw-r--r--netfs/daemon/daemon.cpp4
-rw-r--r--netfs/fuse/netfs.cpp7
-rw-r--r--netfs/unittests/mockMount.cpp1
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
<variant>release:<lto>on
<variant>debug:<warnings>extra
<variant>debug:<warnings-as-errors>on
+ <variant>debug:<cflags>-Wnon-virtual-dtor
<variant>debug:<cflags>-Wold-style-cast
<variant>debug:<cflags>-Wcast-align
+ <variant>debug:<cflags>-Wunused
+ <variant>debug:<cflags>-Woverloaded-virtual
+ <variant>debug:<cflags>-Wpedantic
<variant>debug:<cflags>-Wconversion
<variant>debug:<cflags>-Wsign-conversion
+ <variant>debug:<cflags>-Wnull-dereference
+ <variant>debug:<cflags>-Wdouble-promotion
+ <variant>debug:<cflags>-Wformat=2
+ <variant>debug:<cflags>-Wshadow
+ <toolset>gcc,<variant>debug:<cflags>-Wduplicated-cond
+ <toolset>gcc,<variant>debug:<cflags>-Wduplicated-branches
<toolset>gcc,<variant>debug:<cflags>-Wlogical-op
<toolset>gcc,<variant>debug:<cflags>-Wuseless-cast
<variant>coverage:<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;