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:17:49 UTC
[orc] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/main by this push:
new 95541a8 ORC-1042: Ignore unused-function C++ compile warning on CentOS 7 (#956)
95541a8 is described below
commit 95541a8b71f53d828c8f2debf9fc96ab32917288
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.
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a07153c..c3e5d49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,6 +107,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 ()