From patchwork Tue Oct 3 12:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 77022 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB69D3830B53 for ; Tue, 3 Oct 2023 12:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB69D3830B53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1696337247; bh=UJ4cUBFLkzZGgn57m1vMCPiYkjyUp9v4XcHfVDkAuIw=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RsAkXNczfyss7N030nKogwUnWiL7U839FIoF86qAuNJfISHa4XnXQGZK/DlWn4DJY +NVPnc2mwEszmNH8nYTawWGsW9iM7PJHVyaghW8R5kjD9eVQ7zC0bqKqdZhih9RR7N 8f58stZc0KTsB7W0RxtruIEhdfNeYqP8A9875V+0= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C665C3857731 for ; Tue, 3 Oct 2023 12:47:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C665C3857731 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-4HONV9feOe-3Hc0ZXBSjKQ-1; Tue, 03 Oct 2023 08:47:21 -0400 X-MC-Unique: 4HONV9feOe-3Hc0ZXBSjKQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-65b14f88921so9695356d6.0 for ; Tue, 03 Oct 2023 05:47:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696337240; x=1696942040; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UJ4cUBFLkzZGgn57m1vMCPiYkjyUp9v4XcHfVDkAuIw=; b=Nrl8oEUdGJaWJAUOssJapP0kOe8npIRVYPEA6mhwDGBjO7T54bWEB34Iig6exlGE72 dKDBkUKtjZtGO8OYSxH6PO7cz6swtCwLoj8hfTWeoOr+ySESCpIMNh1RnAJODk4y01E9 tydISDTXGf0d/cEroWK62OY7/1CkVhuUIt19hgVyL2oeB/Axs/Q2KKJPQqqiJF+PyYP8 /FtkZzyj3dEgU75hGMArMKF6Y8IrZvpjM2oHRiedU8Qy1ABc2hpWdo9eWQqbJjo8LXgO Crimrq/tG7b871ZYMm5vhksQ7xL8D8Ujps6xGeU/NAlIGrqwpErdDx6YQjSFVkFGBlr6 lUNw== X-Gm-Message-State: AOJu0YxTSNgPTVpK8uHCygtSoYS8mdYt1P3VyoLImHFb/Y4iXh2pCMza PuWZ2vPzuG6zNYXGsqunepI0LOJ7ZARtlsS1tg2/eHFsvLIeNoMpsbObjMSNBINsdHyWheGaiWM po/hoYTL/pSbEsfDHQZOP2fidVE9P X-Received: by 2002:a0c:e383:0:b0:65d:31e:b80f with SMTP id a3-20020a0ce383000000b0065d031eb80fmr17357479qvl.35.1696337240446; Tue, 03 Oct 2023 05:47:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMVIx7HqdcibVhIgkrTF9j7A69yWH8+jmJL7oVruuCenGQvMPBxKLedqrAWWl88ZfppyB6KQ== X-Received: by 2002:a0c:e383:0:b0:65d:31e:b80f with SMTP id a3-20020a0ce383000000b0065d031eb80fmr17357465qvl.35.1696337240178; Tue, 03 Oct 2023 05:47:20 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id s28-20020a05620a031c00b00767d2870e39sm424540qkm.41.2023.10.03.05.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 05:47:19 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 46522B6E87; Tue, 3 Oct 2023 14:47:18 +0200 (CEST) To: Dodji Seketeli Subject: [PATCH 2/4] For WIP branch check-uapi-support: default-reporter,reporter-priv: Do not report names of anonymous enums Organization: Red Hat / France References: <874jj7hp6e.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Tue, 03 Oct 2023 14:47:18 +0200 In-Reply-To: <874jj7hp6e.fsf@redhat.com> (Dodji Seketeli's message of "Tue, 03 Oct 2023 14:21:29 +0200") Message-ID: <87v8bng9ex.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Cc: libabigail@sourceware.org Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" 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 OK for branch check-uapi-support? --- 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))