distinct_diff: avoid expression with side effects within typeid
authorMatthias Maennich via libabigail <libabigail@sourceware.org>
Mon, 15 Apr 2019 17:05:21 +0000 (18:05 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 16 Apr 2019 14:11:01 +0000 (16:11 +0200)
commit573995d1f5f12712c397520292da3e5b797ad98a
tree0342305ea59f38ad8018754b33a45da34ff4f95e
parentb6243371a68d8ec8a80eb24b924ec4f652516055
distinct_diff: avoid expression with side effects within typeid

When compiling with clang, the following warning is emitted:

abg-comparison.cc:2674:17: warning: expression with side effects will be
evaluated despite being used as an operand to 'typeid' [-Wpotentially-evaluated-expression]
  return typeid(*first.get()) != typeid(*second.get());
                ^

Mitigate that warning by moving potential side effects out of typeid.

 * src/abg-comparison.cc: fix clang warning "potentially-evaluated-expression"

Signed-off-by: Matthias Maennich <maennich@google.com>
src/abg-comparison.cc