From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14428 invoked by alias); 13 Jun 2016 08:22:13 -0000 Mailing-List: contact libabigail-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: libabigail-owner@sourceware.org Received: (qmail 14266 invoked by uid 48); 13 Jun 2016 08:22:00 -0000 From: "dodji at redhat dot com" To: libabigail@sourceware.org Subject: [Bug default/20199] disregard harmless type synonyms Date: Fri, 01 Jan 2016 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: libabigail X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dodji at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2016-q2/txt/msg00118.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D20199 --- Comment #2 from dodji at redhat dot com --- Yes, this would indeed be a useful feature. If I understand correctly, I think the existence of these synonyms is due to the fact that type specifiers can be present in any order and that the "unsigned" and "signed" type specifiers can be used alone (i.e, not conceptually follow or precede another type specifier), in which case they = mean "unsigned or signed int". So doing a naive lexicographic string comparison= of type names to detect if they are different doesn't work in this case. The way libabigail is designed to deal with these spurious differences is to consider the two types as being different and then filter out that differen= ce later at reporting type. Note that when we are in presence of a diff between two types that have different names, that diff is represented in the Abigail internal representation (IR) by the class abigail::comparison::distinct_diff, docume= nted at https://sourceware.org/libabigail/apidoc/classabigail_1_1comparison_1_1dist= inct__diff.html. So I am guessing that we could add code that would detect that those two distinct types (once their types qualifiers have been stripped off) are base types (represented in the IR by the class abigail::ir::type_decl, documente= d at https://sourceware.org/libabigail/apidoc/classabigail_1_1ir_1_1type__decl.h= tml) and parse the type-specifiers of the type into a bitmap, each bit represent= ing one type-specifier. If the two bitmaps are equal then the two types are synonyms. I think this detection should be restricted to binaries coming f= rom C and C++ languages only. This work would happen in the pass that walks the graph of diff nodes to de= tect harmless diff nodes, in abg-comp-filter.cc, especially in the member functi= on=20 harmless_filter::visit(). When two subjects of a diff are detected as syno= nyms then the diff node should be categorized as HARMLESS_DECL_NAME_CHANGE_CATEG= ORY. Note that that "filtering" passes where different filters are applied to the graph of diff nodes are triggered the member function corpus_diff::apply_filters_and_suppressions_before_reporting() that is itse= lf invoked in the member function corpus_diff::report(). --=20 You are receiving this mail because: You are on the CC list for the bug.