From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Cc: dodji@redhat.com, John Moon <quic_johmoo@quicinc.com>,
Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
Trilok Soni <quic_tsoni@quicinc.com>
Subject: [PATCH 1/3, V2] For WIP branch check-uapi-support: default-reporter,reporter-priv: Do not report names of anonymous enums
Date: Wed, 04 Oct 2023 12:52:41 +0200 [thread overview]
Message-ID: <87mswypsli.fsf@redhat.com> (raw)
In-Reply-To: <87r0mapspt.fsf@redhat.com> (Dodji Seketeli's message of "Wed, 04 Oct 2023 12:50:06 +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>
---
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
next prev parent reply other threads:[~2023-10-04 10:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 10:50 [PATCH 0/3, V2] For WIP branch check-uapi-support: Fix comparing non-reachable " Dodji Seketeli
2023-10-04 10:52 ` Dodji Seketeli [this message]
2023-10-04 10:54 ` [PATCH 2/3, V2] For WIP branch check-uapi-support: ir,comparison,corpus: Better support anonymous enums comparison Dodji Seketeli
2023-10-04 10:54 ` [PATCH 3/3, V2] For WIP branch check-uapi-support: ir,comparison: Represent changed anonymous enums 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=87mswypsli.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).