From 833df917a71284d0b32706fc7d10c65b8ef4c15e Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 12 Sep 2022 16:22:28 +0200 Subject: [PATCH] Work around another spurious GCC warning --- src/common/linking.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/linking.cpp b/src/common/linking.cpp index c9de990b..53882f5b 100644 --- a/src/common/linking.cpp +++ b/src/common/linking.cpp @@ -52,7 +52,11 @@ fs::path get_this_file_location() { if (this_file.starts_with("//")) { const size_t path_start_pos = this_file.find_first_not_of('/'); if (path_start_pos != std::string::npos) { - this_file = "/" + this_file.substr(path_start_pos); + // FIXME: This results in a spurious compiler warning if you inline + // `path_start`: + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329 + const std::string path_start = this_file.substr(path_start_pos); + this_file = "/" + path_start; } }