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 d7d21720a ORC-1449: Add `-Wno-unused-macros` for Clang 14.0
d7d21720a is described below
commit d7d21720ae8888e2d13e0e93365bcf9393ca5f9c
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Jun 21 17:46:15 2023 -0700
ORC-1449: Add `-Wno-unused-macros` for Clang 14.0
### What changes were proposed in this pull request?
This PR aims to ignore `unused-macro` warning in Clang 14.0.
### Why are the changes needed?
This is required to test on the latest Mac.
**Environment**
```
$ g++ --version
Apple clang version 14.0.0 (clang-1400.0.28.1)
...
```
**BEFORE**
```
$ make package test-out
...
/Users/dongjoon/APACHE/orc-merge/c++/src/CpuInfoUtil.cc:65:9: error: macro
is not used [-Werror,-Wunused-macros]
#define UNUSED(x) (void)(x)
^
1 error generated.
make[2]: *** [c++/src/CMakeFiles/orc.dir/CpuInfoUtil.cc.o] Error 1
make[1]: *** [c++/src/CMakeFiles/orc.dir/all] Error 2
make: *** [all] Error 2
```
**AFTER**
```
make package test-out
...
100% tests passed, 0 tests failed out of 8
Total Test time (real) = 156.15 sec
Built target test-out
```
### How was this patch tested?
Pass the CIs and manual tests on Clang 14.0.
Closes #1544 from dongjoon-hyun/ORC-1449.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fd27c9dd..4803e8d71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,6 +126,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-missing-noreturn -Wno-unknown-pragmas")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-conversion")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0")
+ set (WARN_FLAGS "${WARN_FLAGS} -Wno-unused-macros")
+ endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-reserved-identifier")
endif()