diff --git a/include/cpptrace/cpptrace.hpp b/include/cpptrace/cpptrace.hpp index fa82593..2768e20 100644 --- a/include/cpptrace/cpptrace.hpp +++ b/include/cpptrace/cpptrace.hpp @@ -159,13 +159,14 @@ namespace cpptrace { public: explicit exception() noexcept : exception(1) {} const char* what() const noexcept override; - // what(), but not a C-string. Performs lazy computation of the full what string. + // what(), but not a C-string. Performs lazy evaluation of the full what string. virtual const std::string& get_what() const noexcept; - // Just the plain what() value without the stacktrace + // Just the plain what() value without the stacktrace. This value is called by get_what() during lazy + // evaluation. virtual const char* get_raw_what() const noexcept; - // returns internal raw_trace + // Returns internal raw_trace const raw_trace& get_raw_trace() const noexcept; - // returns a resolved trace from the raw_trace. Handles lazy evaluation of the resolved trace. + // Returns a resolved trace from the raw_trace. Handles lazy evaluation of the resolved trace. const stacktrace& get_trace() const noexcept; }; diff --git a/src/platform/dwarf.hpp b/src/platform/dwarf.hpp index a4593f0..5913fc2 100644 --- a/src/platform/dwarf.hpp +++ b/src/platform/dwarf.hpp @@ -19,10 +19,10 @@ namespace libdwarf { static_assert(std::is_pointer::value, "Dwarf_Debug not a pointer"); [[noreturn]] void handle_dwarf_error(Dwarf_Debug dbg, Dwarf_Error error) { - int ev = dwarf_errno(error); + unsigned ev = dwarf_errno(error); char* msg = dwarf_errmsg(error); dwarf_dealloc_error(dbg, error); - throw std::runtime_error(stringf("Cpptrace dwarf error %d %s\n", ev, msg)); + throw std::runtime_error(stringf("Cpptrace dwarf error %u %s\n", ev, msg)); } struct die_object { @@ -68,14 +68,14 @@ namespace libdwarf { die_object& operator=(const die_object&) = delete; - die_object(die_object&& other) : dbg(other.dbg), die(other.die) { + die_object(die_object&& other) noexcept : dbg(other.dbg), die(other.die) { // done for finding mistakes, attempts to use the die_object after this should segfault // a valid use otherwise would be moved_from.get_sibling() which would get the next CU other.dbg = nullptr; other.die = nullptr; } - die_object& operator=(die_object&& other) { + die_object& operator=(die_object&& other) noexcept { dbg = other.dbg; die = other.die; other.die = nullptr; diff --git a/src/platform/error.hpp b/src/platform/error.hpp index 978c240..3575f02 100644 --- a/src/platform/error.hpp +++ b/src/platform/error.hpp @@ -100,7 +100,9 @@ namespace detail { } template - void nullfn() {} + void nullfn() { + // this method doesn't do anything and is never called. + } #define PHONY_USE(E) (nullfn())