Open ragliam opened 2 months ago
您的来信我已收到,谢谢
Tried to derive minimal reproducible example:
#include <iostream>
#if __has_cpp_attribute(maybe_unused)
#define MAYBE_UNUSED [[maybe_unused]]
#define LOG 1
#else
#define MAYBE_UNUSED
#define LOG 0
#endif
int main() {
std::cout << LOG << std::endl;
MAYBE_UNUSED int c = 1;
}
and compile with `clang++ test.cpp -o test -std=c++14 -Wall -Werror' and it worked.
Also checked that CMake uses correct clang.
Example fails after adding -pedantic
flag.
Fixed compilation error by cancelling the warning:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a86a568..b2572fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,10 @@ else()
add_cxx_compiler_flag(-fno-exceptions)
endif()
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ add_cxx_compiler_flag(-Wno-c++17-attribute-extensions)
+ endif()
+
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") #ICC17u2: Many false positives for Wstrict-aliasing
add_cxx_compiler_flag(-Wstrict-aliasing)
But what would be the proper solution?
Hi @ragliam , sorry for the late reply. I haven't been building google benchmark for a long time actually, so I haven't seen this issue before. I think you better ask this question in https://github.com/google/benchmark, as there is nothing to fix on the perf-ninja side (I suppose :)).
Hi! When I follow steps from https://github.com/dendibakh/perf-ninja/blob/main/QuickstartMacOS.md, I encounter following error:
My versions are: