Filter out harmless diagnostics glitches due to some ODR violation
authorDodji Seketeli <dodji@redhat.com>
Tue, 8 Dec 2015 11:38:13 +0000 (12:38 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 8 Dec 2015 13:14:09 +0000 (14:14 +0100)
commit9fa5cc298ce8c5761ece44e42286bd1ba55103a3
treeff706fef1837321c29762f773d202ec23eae72a6
parent2eda63d0f24ba85bf525628ac832472e6e4c6e70
Filter out harmless diagnostics glitches due to some ODR violation

Suppose we have tree types which have the same name A.  The first A
comes from a binary B1 and the two others come from a binary B2.
Let's call them A{B1}{1}, A{B2}{1} and A{B2}{2}.

Suppose A{B1}{1} is different from A{B2}{1} (but both types are
compatible), just because one of their sub-types are different but are
compatible. So A{B1}{1} and A{B2}{1} are canonically different; they
have different canonical types.

But then, because of the One Definition Rule (ODR), A{B2}{1} and
A{B2}{2} are canonically equal.  But then let's suppose that A{B2}{2}
is structurally equal to A{B1}{1}.  So this implies that A{B1}{1} and
A{B2}{2} are canonically different, while being structurally equal.

Odd, but not impossible.  I noticed this while comparing the two
versions of libgromacs_d.so.0.0.0 involved in the comparison
referenced by bug https://bugzilla.redhat.com/show_bug.cgi?id=1283906.
But then that library is too big (and takes too much time) to be
included as a non regression test :(

Anyway, this patch detects this glitch and categorizes it so that the
resulting ABI change reports are filtered out.  Otherwise, this is
considered as an ABI change (because of the canonical different), for
which the reporter fails to provide details (because of the structural
equality).

* src/abg-comp-filter.cc
(class_diff_has_harmless_odr_violation_change): New static
function.
(harmless_filter::visit): Call it.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-comp-filter.cc