Skip to content

Commit 4ed10db

Browse files
committed
[clang][cmake] Don't pass -fno-strict-aliasing for GCC
This was added a long time ago.. * to the Makefiles in 40fee63; * first to CMake in b3ce035; * then moved to only apply when building Clang with GCC in c5635a6. This shouldn't be needed these days. If an issue does arise, it really ought to be documented better and the cause will certainly be different than it was back then. The two GCC bugs cited in 40fee63 were: * https://gcc.gnu.org/PR41874 * https://gcc.gnu.org/PR41838 and both are long-fixed. Not only that, if those issues did come up again, we'd be better off doing -Wno-strict-aliasing where appropriate if there weren't a real code issue or some suppression that was tighter in scope wasn't appropriate.
1 parent 951ea8b commit 4ed10db

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

clang/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,6 @@ configure_file(
345345
# Add appropriate flags for GCC
346346
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
347347
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual")
348-
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
349-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
350-
endif ()
351348

352349
# Enable -pedantic for Clang even if it's not enabled for LLVM.
353350
if (NOT LLVM_ENABLE_PEDANTIC)

0 commit comments

Comments
 (0)