diff --git a/src/die.hpp b/src/die.hpp new file mode 100644 index 00000000..633b22ed --- /dev/null +++ b/src/die.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "fmt/core.h" + +[[noreturn]] +static +inline +void +die(std::string_view msg_) +{ + fmt::println(stderr,"FATAL: {}",msg_); + std::abort(); +} diff --git a/src/fs_stat.hpp b/src/fs_stat.hpp index c3e60c98..160d8621 100644 --- a/src/fs_stat.hpp +++ b/src/fs_stat.hpp @@ -97,6 +97,7 @@ namespace fs return rv; } + die("Should never reach this"); return -ENOENT; } }