summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-11-07 15:22:15 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-11-07 15:36:35 +0100
commit4b91c4314090e02f7bc9ea44bed2e5a49010b305 (patch)
tree6f206d36090ebfd2bacf381313fc83590a109808
parent26010d2cfb80ced0459d877ef3ba3e349347417a (diff)
downloadjustbuild-4b91c4314090e02f7bc9ea44bed2e5a49010b305.tar.gz
Silence GCC warnings on missing return statements
-rw-r--r--src/buildtool/crypto/TARGETS2
-rw-r--r--src/buildtool/crypto/hash_function.hpp3
-rw-r--r--src/buildtool/file_system/TARGETS1
-rw-r--r--src/buildtool/file_system/object_type.hpp4
-rw-r--r--src/buildtool/logging/TARGETS1
-rw-r--r--src/buildtool/logging/log_level.hpp3
6 files changed, 13 insertions, 1 deletions
diff --git a/src/buildtool/crypto/TARGETS b/src/buildtool/crypto/TARGETS
index 5f72452a..db72b11d 100644
--- a/src/buildtool/crypto/TARGETS
+++ b/src/buildtool/crypto/TARGETS
@@ -14,7 +14,7 @@
{ "type": ["@", "rules", "CC", "library"]
, "name": ["hash_function"]
, "hdrs": ["hash_function.hpp"]
- , "deps": ["hasher"]
+ , "deps": ["hasher", ["@", "gsl-lite", "", "gsl-lite"]]
, "stage": ["src", "buildtool", "crypto"]
}
}
diff --git a/src/buildtool/crypto/hash_function.hpp b/src/buildtool/crypto/hash_function.hpp
index 0439ecc7..ac7cadcc 100644
--- a/src/buildtool/crypto/hash_function.hpp
+++ b/src/buildtool/crypto/hash_function.hpp
@@ -20,6 +20,8 @@
#include <optional>
#include <string>
+#include <gsl-lite/gsl-lite.hpp>
+
#include "src/buildtool/crypto/hasher.hpp"
/// \brief Hash function used for the entire buildtool.
@@ -69,6 +71,7 @@ class HashFunction {
case JustHash::Compatible:
return ::Hasher{Hasher::HashType::SHA256};
}
+ gsl_Ensures(false); // unreachable
}
private:
diff --git a/src/buildtool/file_system/TARGETS b/src/buildtool/file_system/TARGETS
index 228cc3c9..830a7947 100644
--- a/src/buildtool/file_system/TARGETS
+++ b/src/buildtool/file_system/TARGETS
@@ -2,6 +2,7 @@
{ "type": ["@", "rules", "CC", "library"]
, "name": ["object_type"]
, "hdrs": ["object_type.hpp"]
+ , "deps": [["@", "gsl-lite", "", "gsl-lite"]]
, "stage": ["src", "buildtool", "file_system"]
}
, "file_system_manager":
diff --git a/src/buildtool/file_system/object_type.hpp b/src/buildtool/file_system/object_type.hpp
index 426b1458..661ab657 100644
--- a/src/buildtool/file_system/object_type.hpp
+++ b/src/buildtool/file_system/object_type.hpp
@@ -16,6 +16,8 @@
#define INCLUDED_SRC_BUILDTOOL_FILE_SYSTEM_OBJECT_TYPE_HPP
#include <cstdint>
+#include <gsl-lite/gsl-lite.hpp>
+
enum class ObjectType : std::int8_t {
File,
Executable,
@@ -31,6 +33,7 @@ enum class ObjectType : std::int8_t {
default:
return ObjectType::File;
}
+ gsl_Ensures(false); // unreachable
}
[[nodiscard]] constexpr auto ToChar(ObjectType type) -> char {
@@ -42,6 +45,7 @@ enum class ObjectType : std::int8_t {
case ObjectType::Tree:
return 't';
}
+ gsl_Ensures(false); // unreachable
}
[[nodiscard]] constexpr auto IsFileObject(ObjectType type) -> bool {
diff --git a/src/buildtool/logging/TARGETS b/src/buildtool/logging/TARGETS
index 6521b0fb..36b3f9c0 100644
--- a/src/buildtool/logging/TARGETS
+++ b/src/buildtool/logging/TARGETS
@@ -2,6 +2,7 @@
{ "type": ["@", "rules", "CC", "library"]
, "name": ["log_level"]
, "hdrs": ["log_level.hpp"]
+ , "deps": [["@", "gsl-lite", "", "gsl-lite"]]
, "stage": ["src", "buildtool", "logging"]
}
, "logging":
diff --git a/src/buildtool/logging/log_level.hpp b/src/buildtool/logging/log_level.hpp
index 6ae97b94..55b66790 100644
--- a/src/buildtool/logging/log_level.hpp
+++ b/src/buildtool/logging/log_level.hpp
@@ -19,6 +19,8 @@
#include <string>
#include <type_traits>
+#include <gsl-lite/gsl-lite.hpp>
+
enum class LogLevel {
Error, ///< Error messages, fatal errors
Warning, ///< Warning messages, recoverable situations that shouldn't occur
@@ -56,6 +58,7 @@ constexpr auto kLastLogLevel = LogLevel::Trace;
case LogLevel::Trace:
return "TRACE";
}
+ gsl_Ensures(false); // unreachable
}
#endif // INCLUDED_SRC_BUILDTOOL_LOGGING_LOG_LEVEL_HPP