abicompat: Add prompt message for abnormal operation

Message ID 20211029085830.30810-1-tangmeng@uniontech.com
State New
Headers
Series abicompat: Add prompt message for abnormal operation |

Commit Message

tangmeng Oct. 29, 2021, 8:58 a.m. UTC
  When using abicompat, if the user configures the
lib2 path while using the xxx option, the configuration
of lib2 is not actually processed in the command
execution process, and there is no prompt message.
It will cause lib2 to be considered to have been processed,
so a warning is added here to prompt the user.

            * tools/abicompat.cc (main): Add warning tips for some actions

Signed-off-by: tangmeng <tangmeng@uniontech.com>
---
 tools/abicompat.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
  

Patch

diff --git a/tools/abicompat.cc b/tools/abicompat.cc
index 60cd794f..989915f3 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
+/// An 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 not 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;