The Git repository of the Libabigail Project
Go to file
Giuliano Procida d5576ba30a Fix decl_base comparison function
When two decl_base ojects are compared, there are both fast and slow
paths to the name comparison. The latter is roughly equivalent to
comparing names after applying the regex
s/(__anonymous_(?:struct|union|enum)__)\d+/\1/g to the names before
comparing them while the former is a straight string comparison with
some tweaks for detecting anonymous types.

The slow path is taken care of by the helper function
tools_utils::decl_names_equal but unfortunately, there is a missing
negation of the returned bool. This commit fixes this and updates the
few affected tests.

Rather than just adding a '!', this commit replaces the negative
decls_are_different with a positive decls_are_same. I spent far too
long staring at the code before I spotted the mistake and having
positively-named things improves readability.

The same helper function is also called by has_harmless_name_change
and that should be reviewed as well.

	* src/abg-ir.cc (equals): In the decl_base overload, note that
	the value returned by decl_names_equal should be negated and
	replace decls_are_different with decls_are_same, negating all
	occurrences.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt:
	Update tests, removing some spurious anonymous union name change.
	* tests/data/test-diff-filter/test33-report-0.txt: Diff now
	completely empty.
	* tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt:
	3 functions previously considered to have harmless changes are
	now deemed to have no changes.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
	1 struct RedStore data member previously considered to have
	harmless changes is now deemed to have no changes.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi:
	One instance of an anonymous struct removed and a typedef
	repointed at another existing instance; many type ids
	renumbered.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-08-04 17:07:24 +02:00
autoconf-archive Do not ignore valgrind checks returning an error 2017-02-27 10:01:15 +01:00
bash-completion Add --self-compare option in fedabipkgdiff 2017-05-31 16:21:14 +05:30
doc abg-writer: Add support for stable hash type ids. 2020-06-16 10:13:01 +02:00
include Fix inheritance of scope_decl::insert_member_decl 2020-07-27 18:04:05 +02:00
m4 Delete ltsugar.m4 and pkg.m4 files from m4/ 2015-01-06 09:54:45 +01:00
scripts Clean up scripts/* 2017-04-14 04:14:12 -04:00
src Fix decl_base comparison function 2020-08-04 17:07:24 +02:00
tests Fix decl_base comparison function 2020-08-04 17:07:24 +02:00
tools abg-writer: Add support for stable hash type ids. 2020-06-16 10:13:01 +02:00
.clang-format clang-format: set continuation indentation to 2 2020-05-18 10:48:09 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
abigail.m4 abigail.m4: Fix copyright notice 2020-05-29 18:11:10 +02:00
AUTHORS
ChangeLog Update ChangeLog 2020-02-26 12:08:52 +01:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Fix typo in COMPILING. 2020-02-03 13:49:54 +01:00
configure.ac Enable Clang's -Werror-overloaded-virtual. 2020-07-27 18:26:16 +02:00
CONTRIBUTING Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00
COPYING Use a better wording for the COPYING file 2015-04-22 09:53:18 +02:00
COPYING-GPLV3 Update licence texts 2015-04-20 13:51:21 +02:00
COPYING-LGPLV2
COPYING-LGPLV3
default.abignore Add default suppression specification for the libvirt project 2018-10-11 10:59:54 +02:00
gen-changelog.py gen-changelog.py: Update the script for python3 2020-02-26 12:06:17 +01:00
install-sh
libabigail.pc.in
ltmain.sh
Makefile.am make: add distcheck-fast target 2020-04-20 14:38:32 +02:00
NEWS Update NEWS file for 1.7 2020-02-26 12:07:29 +01:00
README Fix wording in README 2015-09-05 10:30:00 +02:00
release-text-template.txt Update the release text template after 1.0 2017-11-22 15:55:43 +01:00
update-copyright.sh Update copyright year to 2020 2020-02-21 17:05:01 +01:00
VISIBILITY Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00

This is the Application Binary Interface Generic Analysis and
Instrumentation Library.

It aims at constructing, manipulating, serializing and de-serializing
ABI-relevant artifacts.

The set of artifacts that we are intersted is made of quantities like
types, variable, fonctions and declarations of a given library or
program.  For a given library or program this set of quantities is
called an ABI corpus.

This library aims at (among other things) providing a way to compare
two ABI Corpora (apparently the plural of corpus is copora, heh,
that's cool), provide detailed information about their differences,
and help build tools to infer interesting conclusions about these
differences.

You are welcome to contribute to this project after reading the files
CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree.

Communicating with the maintainers of this project -- including
sending patches to be include to the source code -- happens via email
at libabigail@sourceware.org.