From: Mikko Rasa Date: Mon, 26 Dec 2022 13:30:56 +0000 (+0200) Subject: Avoid zeroing version of -dumpfullversion doesn't return anything X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1e628bf52f9882b22de9b0a36961056d97ae62dc;p=builder.git 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. --- 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); }