Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ add_compile_options(
-Wredundant-decls
-Wformat-security
-Wno-sign-compare
-Wp,-D_GLIBCXX_ASSERTIONS
-D_GLIBCXX_ASSERTIONS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since _GLIBCXX_ASSERTIONS is a C++ standard library (libstdc++) specific macro, it is best practice to restrict it to C++ compilation using a generator expression. This prevents the flag from being passed to C or assembly source files in the project (such as those in subdirectories like ABC or linenoise).

  $<$<COMPILE_LANGUAGE:CXX>:-D_GLIBCXX_ASSERTIONS>

$<$<CXX_COMPILER_ID:Clang>:-Wno-gnu-zero-variadic-macro-arguments>
# Needed for floating point stability in FFT (fft_test will check this).
# See also https://kristerw.github.io/2021/11/09/fp-contract/
Expand Down
Loading