From: David Kastrup Date: Sun, 12 Oct 2014 17:39:15 +0000 (+0200) Subject: Avoid comparing pointers-to-member of covariant types X-Git-Tag: release/2.19.16-1~4^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=30203dfe5c45fb9c6255512ba0f8366b322d303f;p=lilypond.git Avoid comparing pointers-to-member of covariant types The GCC version of current GUB is not happy about those kind of comparisons, so we add a static_cast here. --- diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index 0838a791b2..7b51792567 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -128,7 +128,10 @@ void Smob_base::init () if (&Super::free_smob != &Smob_base::free_smob) scm_set_smob_free (smob_tag_, Super::free_smob); - if (&Super::mark_smob != &Smob_base::mark_smob) + // Old GCC versions refuse comparing pointers-to-member-function of + // covariant types, so we recast here. + if (&Super::mark_smob != + static_cast(&Smob_base::mark_smob)) scm_set_smob_mark (smob_tag_, Super::mark_trampoline); scm_set_smob_print (smob_tag_, Super::print_trampoline); if (&Super::equal_p != &Smob_base::equal_p)