From 68c59c6280c37222348e83c4f57de6116513d8fe Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 26 Dec 2022 22:40:20 +0200 Subject: [PATCH 1/1] Further tweak GnuCompiler::query_version Some compilers return non-numeric version components, like 4.9.x. This change keeps values of all the initial numeric components. --- source/gnucompiler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index 4ee09ed..59ffdf2 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -195,20 +195,19 @@ unsigned GnuCompiler::query_version(const string &exe_path, const string &arg) c argv.push_back(arg); builder.get_logger().log("auxcommands", "Running %s", join(argv.begin(), argv.end())); + unsigned ver = 0; try { string version_str = strip(ExternalTask::run_and_capture_output(argv)); vector version_parts = split(version_str, '.'); - unsigned ver = 0; for(unsigned i=0; (i<3 && i(version_parts[i])<<(16-8*i); - return ver; } catch(const runtime_error &) { } - return 0; + return ver; } Task *GnuCompiler::_run(const ObjectFile &object) -- 2.43.0