kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] 01/02: KUDU-2869. Fix compiler error with devtoolset-7 (gcc 7)
Date Thu, 20 Jun 2019 07:18:49 GMT
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 92f077389dec2b1d9b0bd62ef54d6f9da974b583
Author: Todd Lipcon <todd@apache.org>
AuthorDate: Wed Jun 19 00:09:58 2019 -0700

    KUDU-2869. Fix compiler error with devtoolset-7 (gcc 7)
    
    For whatever reason, some particular C++ syntax used in port.h caused
    gcc 7 to crash with an internal error during compilation. This just
    rephrases the code in a different way to avoid the issue.
    
    Change-Id: Id95a4be07ff1e5ef60a95c65f5a850020f80a273
    Reviewed-on: http://gerrit.cloudera.org:8080/13676
    Tested-by: Kudu Jenkins
    Reviewed-by: Grant Henke <granthenke@apache.org>
---
 src/kudu/gutil/port.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/kudu/gutil/port.h b/src/kudu/gutil/port.h
index 0cf416e..f0b06d7 100644
--- a/src/kudu/gutil/port.h
+++ b/src/kudu/gutil/port.h
@@ -1192,10 +1192,9 @@ using enable_if_numeric = std::enable_if<
 //   int32_t x = UnalignedLoad<int32_t>(void_ptr);
 //
 template<typename T,
-         typename port_internal::enable_if_numeric<T>::type* = nullptr,
-         bool USE_REINTERPRET = port_internal::LoadByReinterpretCast<T>()>
+         typename port_internal::enable_if_numeric<T>::type* = nullptr>
 inline T UnalignedLoad(const void* src) {
-  if (USE_REINTERPRET) {
+  if (port_internal::LoadByReinterpretCast<T>()) {
     return *reinterpret_cast<const T*>(src);
   }
   T ret;
@@ -1213,10 +1212,9 @@ inline T UnalignedLoad(const void* src) {
 // NOTE: this reverses the usual style-guide-suggested order of arguments
 // to match the more natural "*p = v;" ordering of a normal store.
 template<typename T,
-         typename port_internal::enable_if_numeric<T>::type* = nullptr,
-         bool USE_REINTERPRET = port_internal::LoadByReinterpretCast<T>()>
+         typename port_internal::enable_if_numeric<T>::type* = nullptr>
 inline void UnalignedStore(void* dst, const T& src) {
-  if (USE_REINTERPRET) {
+  if (port_internal::LoadByReinterpretCast<T>()) {
     *reinterpret_cast<T*>(dst) = src;
   } else {
     memcpy(dst, &src, sizeof(T));


Mime
View raw message