mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-24 01:46:50 +00:00
In the past, it was common to have a "fake flex array" at the end of a structure. Like this: Nowadays, with improved compiler support, it's more common to use a real flex array. As this is a common change which changes ABI representation in a compatible way, we should have a suppression for it. For example, if you have a change like this: struct foo { int x; int flex[1]; }; ... struct foo { int x; int flex[]; }; abidiff reports: [C] 'struct foo' changed: type size changed from 64 to 32 (in bits) 1 data member change: type of 'int flex[1]' changed: type name changed from 'int[1]' to 'int[]' array type size changed from 32 to 'unknown' array type subrange 1 changed length from 1 to 'unknown' With a new has_strict_flexible_array_data_member_conversion property, users can specify a suppression which stops abidiff from emitting this diff for any "fake" flex arrays being converted to real ones: [suppress_type] type_kind = struct has_size_change = true has_strict_flexible_array_data_member_conversion = true * include/abg-comp-filter.h (has_strict_fam_conversion): Declare new functions. * include/abg-fwd.h (ir::has_fake_flexible_array_data_member): Declare new accessor functions. * include/abg-suppression.h (type_suppression::{,set_}has_strict_fam_conversion): Declare new accessor functions. * src/abg-comp-filter.cc (has_strict_fam_conversion): Define new functions. * src/abg-ir.cc (ir::has_fake_flexible_array_data_member): Define new accessor functions. * src/abg-suppression-priv.h (type_suppression::priv::has_strict_fam_conv_): Define new data member. * src/abg-suppression.cc (type_suppression::{,set_}has_strict_fam_conversion): Define new accessor functions. (type_suppression::suppresses_diff): For a type suppression to match a fake flex array conversion, either the size of the type hasn't change or has_size_change must be true and then the type must change from a fake flex array to a real flex array. (read_type_suppression): Parse the new 'has_strict_flexible_array_data_member_conversion' property to set the type_suppression::set_has_strict_fam_conversion property. * doc/manuals/libabigail-concepts.rst: Add an entry for the new 'has_strict_flexible_array_data_member_conversion' property. * tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-{1,2}.suppr: Add new test suppression files. * tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-report-{1,2}.txt: Add new test reference output files. * tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-v{0,1}.c: Add source code for new binary test input files. * tests/data/test-diff-suppr/test-has-strict-flexible-array-data-member-conversion-v{0,1}.o: Add new binary test input files. * tests/data/Makefile.am: Add the new test files to the source distribution. * tests/test-diff-suppr.cc (in_out_specs): Add the new test input files to this test harness. Signed-off-by: Dodji Seketeli <dodji@redhat.com> Signed-off-by: John Moon <quic_johmoo@quicinc.com> |
||
---|---|---|
.. | ||
api | ||
manuals | ||
vizualization | ||
website | ||
Makefile.am | ||
suppr-doc.txt |