From patchwork Thu Aug 21 12:08:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 118702 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 2A70D385C6F0 for ; Thu, 21 Aug 2025 12:08:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A70D385C6F0 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=elLqs5i2 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 ESMTP id 5C813385C6F0 for ; Thu, 21 Aug 2025 12:08:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C813385C6F0 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 5C813385C6F0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755778101; cv=none; b=TcAtw0yYtpWoCJs278YJMVhDqAHMDNnKjDL/9mIuGIMvoxyOtTTogb3tHsr+U9b2bmUNG8NcpOVEtw/r9SV2BK+mDInUiCY0Fk25I74iK0Mjyh9SVqw0+Y0RdiaTYFJ8dI4PjqBSNmPwNqH0dSw7ujDEweqi8limm2ctNEsNzEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1755778101; c=relaxed/simple; bh=QvRGlfXOpte6e9s3WtPPO/Da2RfUa75nDPfM+tJBPE0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pGbi9661B8qwfpFbD5kQfOuSyk7FIxBMgKAwQNwLfMO3marQzPcRDTTnNgSlKWDPZp0JNF+C0/YT1giS51lfunrAKa/CyLHioib+sW0WPgPBRbTPt76/MYTgW1knv+c6ZuHzy2My9GK1DQ6z4Uj8/8NotxWwOwsz8+VWHcd1cB4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C813385C6F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755778100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=77FzB11htPQyinJtAmnc+Pm9DvHObTmkE3vh4w9lBMo=; b=elLqs5i2zVpEiX+Y/FjP6VAXLSxHkQugZCK3Nl4sdMla0vWzV3h0UyuEU1H4qfej/q8zLz Ihz8SQ9HTCSlO294wZaukRrTpcED1XHLkWfTASXVEg+SS2BKB1Epnt6YOSoAGS9u8aC6Zb tzo10MQNFHE3t3VAKvzj0zc0R0gvrww= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-p3WSqb2bM_23xUkVIsuGCQ-1; Thu, 21 Aug 2025 08:08:16 -0400 X-MC-Unique: p3WSqb2bM_23xUkVIsuGCQ-1 X-Mimecast-MFC-AGG-ID: p3WSqb2bM_23xUkVIsuGCQ_1755778095 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0A67919560B8 for ; Thu, 21 Aug 2025 12:08:15 +0000 (UTC) Received: from localhost (unknown [10.44.22.16]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B553C1955F24 for ; Thu, 21 Aug 2025 12:08:14 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 2294BC1B73C8; Thu, 21 Aug 2025 14:08:12 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applied] Fix compilation with Clang Organization: Red Hat / France X-Operating-System: AlmaLinux 9.6 X-URL: http://www.redhat.com Date: Thu, 21 Aug 2025 14:08:12 +0200 Message-ID: <87wm6wvpw3.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2QA0WLV8Yb5DRH1_dZaicIyI6tR1U_3PHAM8w8CiyL0_1755778095 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 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_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, 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, * include/abg-comparison.h (class type_diff_base): Remove private default constructor. Rather, declare it as a deleted default constructor. (class ptr_to_mbr_diff): The default contructor is deleted, not defaulted. * src/abg-dwarf-reader.cc (get_die_qualified_name): Remove unused function. (die_enum_flat_representation): Add missing parenthesis around "?:" expression coming after the << operator. * src/abg-ir.cc (collect_non_anonymous_data_members): Fix unused variable. * src/abg-suppression.cc (is_negated_suppression): Fix expression that might not be evaluated. * src/abg-tools-utils.cc (ANONYMOUS_SUBRANGE_INTERNAL_NAME_LEN): Remove useless static variable. Signed-off-by: Dodji Seketeli Applied to the mainline. --- include/abg-comparison.h | 6 +++--- src/abg-dwarf-reader.cc | 24 ++++-------------------- src/abg-ir.cc | 2 +- src/abg-suppression.cc | 4 +++- src/abg-tools-utils.cc | 3 --- 5 files changed, 11 insertions(+), 28 deletions(-) diff --git a/include/abg-comparison.h b/include/abg-comparison.h index f4194002..b4ae3f5f 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -1188,8 +1188,6 @@ class type_diff_base : public diff struct priv; std::unique_ptr priv_; - type_diff_base(); - protected: type_diff_base(type_base_sptr first_subject, type_base_sptr second_subject, @@ -1197,6 +1195,8 @@ protected: public: + type_diff_base() = delete; + virtual enum change_kind has_local_changes() const = 0; @@ -1454,7 +1454,7 @@ class ptr_to_mbr_diff : public type_diff_base struct priv; std::unique_ptr priv_; - ptr_to_mbr_diff() = default; + ptr_to_mbr_diff() = delete; protected: ptr_to_mbr_diff(const ptr_to_mbr_type_sptr& first, diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index f1fdc1d3..1c0597f9 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -3287,25 +3287,6 @@ public: return i->second; } - /// Get the qualified name of a given DIE. - /// - /// If the name of the DIE was already computed before just return - /// that name from a cache. Otherwise, build the name, cache it and - /// return it. - /// - /// @param die the DIE to consider. - /// - /// @param where_offset where in the DIE stream we logically are. - /// - /// @return the interned string representing the qualified name of - /// @p die. - interned_string - get_die_qualified_name(Dwarf_Die *die, size_t where_offset) const - { - return const_cast(this)-> - get_die_qualified_name(die, where_offset); - } - /// Get the qualified name of a given DIE which is considered to be /// the DIE for a type. /// @@ -10994,7 +10975,10 @@ die_enum_flat_representation(const reader& rdr, while (dwarf_siblingof(&child, &child) == 0); } - o << one_line ? string("}") : "\n" + indent; + o << (one_line + ? string("}") + : "\n" + indent); + o << "}"; return o.str(); diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 0a2ce5a1..de0703ec 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -5840,7 +5840,7 @@ collect_non_anonymous_data_members(const class_or_union* cou, result = true; } } - return true; + return result; } /// Collect all the non-anonymous data members of a class or union type. diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index 534d32c6..15785ac5 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -312,7 +312,9 @@ is_negated_suppression(const suppression_base& s) bool result = true; try { - dynamic_cast(s); + if (const negated_suppression_base* s_prime = + &dynamic_cast(s)) + return !!s_prime; } catch (...) { diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 68585998..0b72d670 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -615,9 +615,6 @@ const char* get_anonymous_union_internal_name_prefix() {return ANONYMOUS_UNION_INTERNAL_NAME;} -static int ANONYMOUS_SUBRANGE_INTERNAL_NAME_LEN = - strlen(ANONYMOUS_SUBRANGE_INTERNAL_NAME); - /// Getter of the prefix for the name of anonymous enums. /// /// @reaturn the prefix for the name of anonymous enums.