Bug 23708 - categorize void* to pointer change as harmless
authorDodji Seketeli <dodji@redhat.com>
Wed, 3 Oct 2018 09:24:42 +0000 (11:24 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 3 Oct 2018 09:42:47 +0000 (11:42 +0200)
commitcaa100603efcedc748edbd4bdee638827ddcae4b
tree4a0ce113115de6d74aed71c55f9e2fdc60552cc4
parenta16e97596b2c1395b5cac2f8c98e243c6e4eebcd
Bug 23708 - categorize void* to pointer change as harmless

Changing a void* pointer into another pointer of the same size is a
change that is harmless in terms of data layout.

This commit thus categorizes such a change as harmless.

* include/abg-comparison.h (VOID_PTR_TO_PTR_CHANGE_CATEGORY): New
enumerator in the diff_category enum.  Also, adjust the
EVERYTHING_CATEGORY enumerator.
* include/abg-fwd.h (is_void_pointer_type): Declare new function.
* src/abg-comp-filter.cc (has_void_ptr_to_ptr_change): Define new
static function and ...
(categorize_harmless_diff_node): ... use it here.
* src/abg-comparison.cc (get_default_harmless_categories_bitmap):
Add the new abigail::comparison::VOID_PTR_TO_PTR_CHANGE_CATEGORY
category in here.
(operator<<(ostream& o, diff_category c)): Add support for the new
VOID_PTR_TO_PTR_CHANGE_CATEGORY.
* src/abg-ir.cc (is_void_pointer_type): Define new function.
* tests/data/Makefile.am: Add the new test material below to source distribution.
* tests/data/test-diff-filter/test47-filter-void-ptr-change-report-0.txt:
New test reference output.
* tests/data/test-diff-filter/test47-filter-void-ptr-change-v{0,1}.c:
Source code of the new binary test input below.
* tests/data/test-diff-filter/test47-filter-void-ptr-change-v{0,1}.o:
New binary test input.
* tests/test-diff-filter.cc: Add the test input/output above to
test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
12 files changed:
include/abg-comparison.h
include/abg-fwd.h
src/abg-comp-filter.cc
src/abg-comparison.cc
src/abg-ir.cc
tests/data/Makefile.am
tests/data/test-diff-filter/test47-filter-void-ptr-change-report-0.txt [new file with mode: 0644]
tests/data/test-diff-filter/test47-filter-void-ptr-change-v0.c [new file with mode: 0644]
tests/data/test-diff-filter/test47-filter-void-ptr-change-v0.o [new file with mode: 0644]
tests/data/test-diff-filter/test47-filter-void-ptr-change-v1.c [new file with mode: 0644]
tests/data/test-diff-filter/test47-filter-void-ptr-change-v1.o [new file with mode: 0644]
tests/test-diff-filter.cc