From ba18218ec2b8cf32b86aef4c4b539411ef0bd645 Mon Sep 17 00:00:00 2001 From: tangmeng Date: Fri, 29 Oct 2021 17:23:43 +0800 Subject: [PATCH] abicompat: Add prompt message for abnormal operation When using abicompat, if the uses the --weak-mode option and also provides a lib2 path on the command line, the lib2 path is silently ignored. This patch provides a warning to notify the user that the lib2 path is ignored in that case. * tools/abicompat.cc (main): Notify the user when the path to the second library is ignored because the --weak-mode option was provided. Also, fix comment. Signed-off-by: tangmeng Signed-off-by: Dodji Seketeli --- tools/abicompat.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/abicompat.cc b/tools/abicompat.cc index 60cd794f..cf944a49 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -390,7 +390,7 @@ perform_compat_check_in_normal_mode(options& opts, return status; } -/// An description of a change of the type of a function. It contains +/// A description of a change of the type of a function. It contains /// the declaration of the function we are interested in, as well as /// the differences found in the type of that function. struct fn_change @@ -638,6 +638,13 @@ main(int argc, char* argv[]) return 0; } + if (opts.weak_mode && !opts.lib2_path.empty()) + { + emit_prefix(argv[0], cout) + << "WARNING: The \'--weak-mode\' option is used. The " + << opts.lib2_path << " will be ignored automatically\n"; + } + ABG_ASSERT(!opts.app_path.empty()); if (!abigail::tools_utils::check_file(opts.app_path, cerr, opts.prog_name)) return abigail::tools_utils::ABIDIFF_ERROR; -- 2.43.5