public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: Dodji Seketeli <dodji@redhat.com>
Cc: John Moon <quic_johmoo@quicinc.com>,
	 Trilok Soni <quic_tsoni@quicinc.com>,
	 Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
	 libabigail@sourceware.org
Subject: [PATCH 2/7, applied] default-reporter,reporter-priv: Do not report names of anonymous enums
Date: Fri, 20 Oct 2023 11:58:24 +0200	[thread overview]
Message-ID: <874jil7gzj.fsf@redhat.com> (raw)
In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200")

Hello,

When reporting changes of anonymous enums, do not try to report their
qualified name as that doesn't make any sense -- they are anonymous.

Similarly, in report_name_size_and_alignment_changes do not try to
report about changes in the name of an anonymous enum.

	* src/abg-default-reporter.cc (default_reporter::report): In the
	overload for enum_diff, do not get the qualified name of anonymous
	enums.
	* src/abg-reporter-priv.cc
	(report_name_size_and_alignment_changes): Do not report about name
	changes for anonymous enums.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-default-reporter.cc | 12 +++++++++---
 src/abg-reporter-priv.cc    |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc
index b1df9300..c71f8d56 100644
--- a/src/abg-default-reporter.cc
+++ b/src/abg-default-reporter.cc
@@ -162,7 +162,9 @@ default_reporter::report(const enum_diff& d, ostream& out,
 	{
 	  out << indent
 	      << "  '"
-	      << i->get_qualified_name()
+	      << (first->get_is_anonymous()
+		  ? i->get_name()
+		  : i->get_qualified_name())
 	      << "' value '"
 	      << i->get_value()
 	      << "'";
@@ -181,7 +183,9 @@ default_reporter::report(const enum_diff& d, ostream& out,
 	{
 	  out << indent
 	      << "  '"
-	      << i->get_qualified_name()
+	      << (second->get_is_anonymous()
+		  ? i->get_name()
+		  :i->get_qualified_name())
 	      << "' value '"
 	      << i->get_value()
 	      << "'";
@@ -201,7 +205,9 @@ default_reporter::report(const enum_diff& d, ostream& out,
 	{
 	  out << indent
 	      << "  '"
-	      << i->first.get_qualified_name()
+	      << (first->get_is_anonymous()
+		  ? i->first.get_name()
+		  : i->first.get_qualified_name())
 	      << "' from value '"
 	      << i->first.get_value() << "' to '"
 	      << i->second.get_value() << "'";
diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc
index 63a45b80..cc38f240 100644
--- a/src/abg-reporter-priv.cc
+++ b/src/abg-reporter-priv.cc
@@ -965,7 +965,8 @@ report_name_size_and_alignment_changes(decl_base_sptr		first,
   string fn = first->get_qualified_name(),
     sn = second->get_qualified_name();
 
-  if (fn != sn)
+  if (!(first->get_is_anonymous() && second->get_is_anonymous())
+      && fn != sn)
     {
       if (!(ctxt->get_allowed_category() & HARMLESS_DECL_NAME_CHANGE_CATEGORY)
 	  && filtering::has_harmless_name_change(first, second))
-- 
2.39.3



-- 
		Dodji


  parent reply	other threads:[~2023-10-20  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  9:55 [PATCH 0/7, applied to mainline] Support the Linux Kernel UAPI checker project Dodji Seketeli
2023-10-20  9:57 ` [PATCH 1/7, applied] suppression: Add "changed_enumerators_regexp" property Dodji Seketeli
2023-10-20  9:58 ` Dodji Seketeli [this message]
2023-10-20  9:59 ` [PATCH 3/7, applied] ir,comparison,corpus: Better support anonymous enums comparison Dodji Seketeli
2023-10-20 10:00 ` [PATCH 4/7, applied] ir,comparison: Represent changed anonymous enums Dodji Seketeli
2023-10-20 10:01 ` [PATCH 5/7, applied] comparison: Represent changed unreachable anonymous unions, structs & enums Dodji Seketeli
2023-10-20 10:03 ` [PATCH 6/7, applied] Support suppressing data member insertion before a flexible array member Dodji Seketeli
2023-10-20 10:04 ` [PATCH 7/7, applied] suppression: Make the "end" data member offset selector be named boundary Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jil7gzj.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    --cc=quic_johmoo@quicinc.com \
    --cc=quic_satyap@quicinc.com \
    --cc=quic_tsoni@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).