You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2021/11/01 23:19:10 UTC

[orc] branch branch-1.6 updated: ORC-1042: Ignore unused-function C++ compile warning on CentOS 7 (#956)

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.6 by this push:
     new 5565444  ORC-1042: Ignore unused-function C++ compile warning on CentOS 7 (#956)
5565444 is described below

commit 5565444e2f1c9a9426fecb9ab6260df6526a28c4
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Mon Nov 1 16:17:46 2021 -0700

    ORC-1042: Ignore unused-function C++ compile warning on CentOS 7 (#956)
    
    ### What changes were proposed in this pull request?
    
    This PR aims to recover C++ compilation on CentOS 7.
    
    ### Why are the changes needed?
    
    Since https://github.com/apache/orc/pull/951/files, it's broken.
    ```
    Started apache/main on centos7 at Mon Nov  1 10:20:20 AM PDT 2021
    Cloning into 'orc'...
    -- The C compiler identification is GNU 4.8.5
    -- The CXX compiler identification is GNU 4.8.5
    ...
    [ 39%] Building CXX object c++/src/CMakeFiles/orc.dir/io/InputStream.cc.o
    In file included from /root/orc/c++/src/io/InputStream.hh:22:0,
                     from /root/orc/c++/src/io/InputStream.cc:20:
    /root/orc/build/c++/src/Adaptor.hh:188:15: error: 'bool orc::multiplyExact(int64_t, int64_t, int64_t*)' defined but not used [-Werror=unused-function]
       static bool multiplyExact(int64_t value, int64_t repetitions, int64_t* result) {
                   ^
    /root/orc/build/c++/src/Adaptor.hh:200:15: error: 'bool orc::addExact(int64_t, int64_t, int64_t*)' defined but not used [-Werror=unused-function]
       static bool addExact(int64_t sum, int64_t increment, int64_t* result) {
                   ^
    cc1plus: all warnings being treated as errors
    make[2]: *** [c++/src/CMakeFiles/orc.dir/io/InputStream.cc.o] Error 1
    make[1]: *** [c++/src/CMakeFiles/orc.dir/all] Error 2
    make: *** [all] Error 2
    FAILED centos7
    ```
    
    ### How was this patch tested?
    
    Manual test on CentOS.
    
    (cherry picked from commit 95541a8b71f53d828c8f2debf9fc96ab32917288)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
    (cherry picked from commit 395cc1f19435ba68a40669e460c431a202f29d68)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 641ffca..c0436c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   endif ()
 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   set (WARN_FLAGS "-Wall -Wno-unknown-pragmas -Wconversion")
+  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
+    set (WARN_FLAGS "${WARN_FLAGS} -Wno-unused-function")
+  endif ()
   if (STOP_BUILD_ON_WARNING)
     set (WARN_FLAGS "${WARN_FLAGS} -Werror")
   endif ()