From patchwork Fri Oct 20 09:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 78213 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 329B6385841B for ; Fri, 20 Oct 2023 09:58:49 +0000 (GMT) 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.133.124]) by sourceware.org (Postfix) with ESMTPS id E944A3858D20 for ; Fri, 20 Oct 2023 09:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E944A3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E944A3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795925; cv=none; b=T3XQH65iqKrLFDZiersfqXbaJrVJq2rkm0TTz21nQhV7VK8jpx4gw0Hwe0wmyCA1v6pD4GqMOzARpP+FhOmUzbYJ/bMtAm6oC6F+C6m37v7oiYHe1dlodcxhtCF1po2gFcz2FcW/lWLt4OM150uq+xv8OOuQXcyCqH0PV9fPij4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795925; c=relaxed/simple; bh=cgrmZL6qeyx9Gn1SXkVdEieYP3tDmHpUXPsBKVAeCAU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Yfe6d1l9TWnAay5XYqrRocD8R9EcgjonyWrwmpK55UAuGTToIixI+uSsJHJvdz8PKWKRX1wgzr3N+b1Jhrap753fqzvO4TMdUFqyHPQhp8IG5w7VUAr8KvcO7FBDUt0hHtJg85gm20ifa98rbdTq0j7H8qjzJAYSxPF/gMR+sFY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697795923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2W9kaM1PDB+KJrcYA5R/KolxKmKZMdH7rXSmVTWuGrA=; b=PaKzWhUNh5XJ7Sa7ZB0dNSieW7SFzQ2P+wOdhWBG6Yj1oZRLLHjGDk9Whn5w+jIFZcbZSi LGs18zDKTkGllVRzpx9M2zXn292hv/jHtE9bgW8+inw76VkeAMSOt9Yi6XVPUkmcZfJ+bG 5HgrFrr7duga8IYvIN0NiB1ZvGJ3J9c= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-118-c8vdAmb-O9y60xA9UDWjFg-1; Fri, 20 Oct 2023 05:58:26 -0400 X-MC-Unique: c8vdAmb-O9y60xA9UDWjFg-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-4180bc4227bso27506151cf.1 for ; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697795906; x=1698400706; 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=2W9kaM1PDB+KJrcYA5R/KolxKmKZMdH7rXSmVTWuGrA=; b=WevzaCVLezDbLf0GUVhfE1uSlHbYkTrePic+rccdZBMOVGdf5ac+Z3noAEKLUWECGV AN/UuvMBrUYbd7xPhqWn9ur5vdlmecD/+VXFDRBsB0Jsz2WgKGeopKbfmvb3/s5k51Qk yUUVpBRc/ehsXwjMdy90Pqj/QP6J0Pxe//fA24r6icNXqJ2sJsRXjNp1PMfbz943zJOp 1NGK6oFJlbGhLtGW2EtXeqOfrPBWUo0E06XnRvDfQOLxEV1KmSf7xg+F5U9Zd9Wtd6ym USTlHfyFtP5hwUfOFuEsFVQIiF4vROKQ9ufONInnRcL0khQSYaA5wv7xRD2Z5OaBK5r9 3E1g== X-Gm-Message-State: AOJu0YxVzqdVCYwNRHQBI1fRmDRvA6omeTyq9RIg4MNPE41OdFrWaXxG RkCocqwyzYJaI2a7mawsq4DDIyDYrH+E4gQWjVQg5Owz0+lqMHj7LvmJ8PvKwaZIzqTCwHR+zjy Z4hEP7Zzel+KQISiBUvBG X-Received: by 2002:ac8:5c04:0:b0:3f9:d1c3:cc45 with SMTP id i4-20020ac85c04000000b003f9d1c3cc45mr5832395qti.28.1697795906437; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRUUyFmxLFwevYFLo1aDtAPMkcbXV8sqHUmX0SXimFEecvrumkeM6NAkrSGZieh13ZubK7Jg== X-Received: by 2002:ac8:5c04:0:b0:3f9:d1c3:cc45 with SMTP id i4-20020ac85c04000000b003f9d1c3cc45mr5832387qti.28.1697795906171; Fri, 20 Oct 2023 02:58:26 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id g14-20020ac84b6e000000b00419cb97418bsm476064qts.15.2023.10.20.02.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:58:25 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 243045077C49; Fri, 20 Oct 2023 11:58:24 +0200 (CEST) From: Dodji Seketeli To: Dodji Seketeli Cc: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala , libabigail@sourceware.org Subject: [PATCH 2/7, applied] default-reporter,reporter-priv: Do not report names of anonymous enums Organization: Red Hat / France References: <87cyx97h4j.fsf@redhat.com> X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 11:58:24 +0200 In-Reply-To: <87cyx97h4j.fsf@redhat.com> (Dodji Seketeli's message of "Fri, 20 Oct 2023 11:55:24 +0200") Message-ID: <874jil7gzj.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_H3, 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-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org 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 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))