aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/logging.cc4
-rw-r--r--src/libutil/source-path.cc1
-rw-r--r--src/libutil/util.cc2
-rw-r--r--src/libutil/util.hh4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 691b77e95..0e63f9bd6 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -69,8 +69,8 @@ public:
case lvlWarn: c = '4'; break;
case lvlNotice: case lvlInfo: c = '5'; break;
case lvlTalkative: case lvlChatty: c = '6'; break;
- case lvlDebug: case lvlVomit: c = '7'; break;
- default: c = '7'; break; // should not happen, and missing enum case is reported by -Werror=switch-enum
+ case lvlDebug: case lvlVomit:
+ default: c = '7'; break; // default case should not happen, and missing enum case is reported by -Werror=switch-enum
}
prefix = std::string("<") + c + ">";
}
diff --git a/src/libutil/source-path.cc b/src/libutil/source-path.cc
index e6721f808..cfaac20c0 100644
--- a/src/libutil/source-path.cc
+++ b/src/libutil/source-path.cc
@@ -50,6 +50,7 @@ InputAccessor::DirEntries SourcePath::readDirectory() const
case DT_REG: type = InputAccessor::Type::tRegular; break;
case DT_LNK: type = InputAccessor::Type::tSymlink; break;
case DT_DIR: type = InputAccessor::Type::tDirectory; break;
+ default: break; // unknown type
}
res.emplace(entry.name, type);
}
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 9b65bd77f..5cd4df8e6 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -947,7 +947,7 @@ Pid::Pid(pid_t pid)
}
-Pid::~Pid()
+Pid::~Pid() noexcept(false)
{
if (pid != -1) kill();
}
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 860ddae06..29a70447e 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -335,7 +335,7 @@ public:
AutoCloseFD(AutoCloseFD&& fd);
~AutoCloseFD();
AutoCloseFD& operator =(const AutoCloseFD & fd) = delete;
- AutoCloseFD& operator =(AutoCloseFD&& fd);
+ AutoCloseFD& operator =(AutoCloseFD&& fd) noexcept(false);
int get() const;
explicit operator bool() const;
int release();
@@ -384,7 +384,7 @@ class Pid
public:
Pid();
Pid(pid_t pid);
- ~Pid();
+ ~Pid() noexcept(false);
void operator =(pid_t pid);
operator pid_t();
int kill();