]> git.donarmstrong.com Git - lilypond.git/commitdiff
Avoid comparing pointers-to-member of covariant types
authorDavid Kastrup <dak@gnu.org>
Sun, 12 Oct 2014 17:39:15 +0000 (19:39 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 12 Oct 2014 17:40:22 +0000 (19:40 +0200)
The GCC version of current GUB is not happy about those kind of
comparisons, so we add a static_cast here.

lily/include/smobs.tcc

index 0838a791b247d0f0a03202f096fbde7dc625571a..7b5179256709db8570a1137109a6b1f9f14bfa4b 100644 (file)
@@ -128,7 +128,10 @@ void Smob_base<Super>::init ()
 
   if (&Super::free_smob != &Smob_base<Super>::free_smob)
     scm_set_smob_free (smob_tag_, Super::free_smob);
-  if (&Super::mark_smob != &Smob_base<Super>::mark_smob)
+  // Old GCC versions refuse comparing pointers-to-member-function of
+  // covariant types, so we recast here.
+  if (&Super::mark_smob !=
+      static_cast<SCM (Super::*)()>(&Smob_base<Super>::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<Super>::equal_p)