From: Peter van Dijk Date: Wed, 8 Jun 2016 07:35:53 +0000 (-0400) Subject: disable assertion; make recursor work on el6 i386 again. X-Git-Tag: rec-4.0.0-rc1~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3961%2Fhead;p=thirdparty%2Fpdns.git disable assertion; make recursor work on el6 i386 again. Thanks @nlyan @sspans. Closes #3695 --- diff --git a/pdns/mtasker_ucontext.cc b/pdns/mtasker_ucontext.cc index 5bd19bd6f8..bb43bad73a 100644 --- a/pdns/mtasker_ucontext.cc +++ b/pdns/mtasker_ucontext.cc @@ -17,8 +17,12 @@ static inline std::pair splitPointer (void* const ptr) noexcept { static_assert (sizeof(int) == 4, "splitPointer() requires an 4 byte 'int'"); - static_assert (sizeof(uintptr_t) == 8, - "splitPointer() requires an 8 byte 'uintptr_t'"); +// In theory, we need this assertion. In practice, it prevents compilation +// on EL6 i386. Without the assertion, everything works. +// If you ever run into trouble with this code, please heed the warnings at +// http://man7.org/linux/man-pages/man3/makecontext.3.html#NOTES +// static_assert (sizeof(uintptr_t) == 8, +// "splitPointer() requires an 8 byte 'uintptr_t'"); std::pair words; auto rep = reinterpret_cast(ptr); uint32_t const hw = rep >> 32; @@ -32,8 +36,9 @@ template static inline T* joinPtr (int const first, int const second) noexcept { static_assert (sizeof(int) == 4, "joinPtr() requires an 4 byte 'int'"); - static_assert (sizeof(uintptr_t) == 8, - "joinPtr() requires an 8 byte 'uintptr_t'"); +// See above. +// static_assert (sizeof(uintptr_t) == 8, +// "joinPtr() requires an 8 byte 'uintptr_t'"); uint32_t hw; uint32_t lw; std::memcpy (&hw, &first, 4);