]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
disable assertion; make recursor work on el6 i386 again. 3961/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 8 Jun 2016 07:35:53 +0000 (03:35 -0400)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 8 Jun 2016 07:51:40 +0000 (03:51 -0400)
Thanks @nlyan @sspans. Closes #3695

pdns/mtasker_ucontext.cc

index 5bd19bd6f84ecd8c21226f3edaef515abae62d4b..bb43bad73a62a824526f9bd7325994873bc8854b 100644 (file)
@@ -17,8 +17,12 @@ static inline
 std::pair<int, int>
 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<int, int> words;
     auto rep = reinterpret_cast<uintptr_t>(ptr);
     uint32_t const hw = rep >> 32;
@@ -32,8 +36,9 @@ template <typename T> 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);