Bug 24787 - Filter out enum changes into compatible integer types
authorDodji Seketeli <dodji@redhat.com>
Fri, 19 Jul 2019 15:45:27 +0000 (17:45 +0200)
committerDodji Seketeli <dodji@redhat.com>
Fri, 19 Jul 2019 16:22:12 +0000 (18:22 +0200)
commitf2437aabad085e9f9c99d28e94ac0f046e224763
tree22819003976dc9c5462c2f8568760455896e70e0
parent3df54522b8d90a93c9d22ed4b951b2a23b25f3af
Bug 24787 - Filter out enum changes into compatible integer types

Libabigail's filtering engine fails to recognize an enum changing into
a compatible integer (or vice versa) as a harmless change.

This patch fixes that.

* include/abg-comparison.h (peel_typedef_or_qualified_type_diff):
Declare new function.
(peel_pointer_or_qualified_type_diff): Rename
peel_pointer_or_qualified_type into this.
* include/abg-fwd.h (is_enum_type): Declare a new overload for
type_or_decl_base*.
* src/abg-comp-filter.cc (has_harmless_enum_to_int_change): Define
new static function.
* src/abg-comparison.cc (categorize_harmless_diff_node): Use the
new has_harmless_enum_to_int_change here.
(peel_pointer_or_qualified_type_diff): Renamed
peel_pointer_or_qualified_type into this.
(is_diff_of_basic_type): Adjust.
(peel_typedef_or_qualified_type_diff): Define new function.
* test-diff-filter/PR24787-lib{one, two}.so: New test input
binaries.
* test-diff-filter/PR24787-{one, two}.c: Source files of the test
input binaries above.
* test-diff-filter/PR24787-report-0.txt: Test output reference.
* tests/data/Makefile.am: Add the new testing material to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test to
the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-comparison.h
include/abg-fwd.h
src/abg-comp-filter.cc
src/abg-comparison.cc
tests/data/Makefile.am
tests/data/test-diff-filter/PR24787-libone.so [new file with mode: 0755]
tests/data/test-diff-filter/PR24787-libtwo.so [new file with mode: 0755]
tests/data/test-diff-filter/PR24787-one.c [new file with mode: 0644]
tests/data/test-diff-filter/PR24787-report-0.txt [new file with mode: 0644]
tests/data/test-diff-filter/PR24787-two.c [new file with mode: 0644]
tests/test-diff-filter.cc