From 1e628bf52f9882b22de9b0a36961056d97ae62dc Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 26 Dec 2022 15:30:56 +0200 Subject: [PATCH] Avoid zeroing version of -dumpfullversion doesn't return anything Clang doesn't seem to recognize it. This is a bit of a hack and it would be better if ClangCompiler could handle the version check somehow, but it's not obvious how to do that. --- source/gnucompiler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/gnucompiler.cpp b/source/gnucompiler.cpp index a96f5a3..beff9f9 100644 --- a/source/gnucompiler.cpp +++ b/source/gnucompiler.cpp @@ -178,7 +178,11 @@ void GnuCompiler::prepare_version(ToolData &tool) const string exe_path = exe->get_path().str(); unsigned version = query_version(exe_path, "-dumpversion"); if(version>=0x70000) - version = query_version(exe_path, "-dumpfullversion"); + { + unsigned v = query_version(exe_path, "-dumpfullversion"); + if(v) + version = v; + } tool.extra_data = version; builder.get_logger().log("tools", "%s version is %d.%d.%d", FS::basename(exe->get_path()), version>>16, (version>>8)&0xFF, version&0xFF); } -- 2.43.0