[clang][cmake] Don't pass -fno-strict-aliasing for GCC · llvm/llvm-project@4ed10db (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 4ed10db

[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 inc5635a6. 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/PR41838and 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.

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 0 additions & 3 deletions

Original file line number Diff line number Diff line change
@@ -345,9 +345,6 @@ configure_file(
345 345 # Add appropriate flags for GCC
346 346 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
347 347 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 ()
351 348
352 349 # Enable -pedantic for Clang even if it's not enabled for LLVM.
353 350 if (NOT LLVM_ENABLE_PEDANTIC)