From ff9f1516394cdf952de5d9f9543af02cb5d881c8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 7 May 2020 16:51:50 +0200 Subject: [PATCH] Work around incorrect GCC warning in debug builds --- src/plugin/plugin-bridge.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugin/plugin-bridge.cpp b/src/plugin/plugin-bridge.cpp index 740f34f5..3cb7b1a4 100644 --- a/src/plugin/plugin-bridge.cpp +++ b/src/plugin/plugin-bridge.cpp @@ -709,16 +709,16 @@ PluginArchitecture find_vst_architecture(fs::path plugin_path) { case 0x0000: // IMAGE_FILE_MACHINE_UNKNOWN return PluginArchitecture::vst_64; break; - default: { - std::ostringstream error_msg; - error_msg << "'" << plugin_path - << "' is neither a x86 nor a x86_64 PE32 file. Actual " - "architecture: 0x" - << std::hex << machine_type; - - throw std::runtime_error(error_msg.str()); - } break; } + + // When compiled without optimizations, GCC 9.3 will warn that the function + // does not return if we put this in a `default:` case instead. + std::ostringstream error_msg; + error_msg << "'" << plugin_path + << "' is neither a x86 nor a x86_64 PE32 file. Actual " + "architecture: 0x" + << std::hex << machine_type; + throw std::runtime_error(error_msg.str()); } fs::path find_vst_host(PluginArchitecture plugin_arch) {