Copilot commented on code in PR #49604:
URL: https://github.com/apache/arrow/pull/49604#discussion_r2998638376
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3882,6 +3882,10 @@ function(build_awssdk)
string(APPEND CMAKE_C_FLAGS " -D_WIN32_WINNT=0x0601")
string(APPEND CMAKE_CXX_FLAGS " -D_WIN32_WINNT=0x0601")
endif()
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ string(APPEND CMAKE_C_FLAGS " -Wno-implicit-fallthrough")
+ string(APPEND CMAKE_CXX_FLAGS " -Wno-implicit-fallthrough")
+ endif()
Review Comment:
The `-Wno-implicit-fallthrough` flag is being added based on
`CMAKE_CXX_COMPILER_ID`, but it’s appended to both `CMAKE_C_FLAGS` and
`CMAKE_CXX_FLAGS`. In mixed-toolchain setups (different C and C++ compilers),
this can fail to apply when needed or apply based on the wrong compiler.
Consider checking `CMAKE_C_COMPILER_ID` for the C flags and
`CMAKE_CXX_COMPILER_ID` for the C++ flags (or guarding each independently),
ideally using `check_c_compiler_flag`/`check_cxx_compiler_flag` so unsupported
flags don’t break builds.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]