From d88353b8fa18ad17d209d9ebc9cd05dad6be6ec3 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 8 Jun 2016 03:35:53 -0400 Subject: [PATCH] disable assertion; make recursor work on el6 i386 again. Thanks @nlyan @sspans. Closes #3695 --- pdns/mtasker_ucontext.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pdns/mtasker_ucontext.cc b/pdns/mtasker_ucontext.cc index 5bd19bd6f..bb43bad73 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); -- 2.40.0