Skip to content
Snippets Groups Projects
Commit 3b7c94f7 authored by Robert Schmidt's avatar Robert Schmidt
Browse files

Use FORTIFY_SOURCE in release builds

gcc-14 warns when using FORTIFY_SOURCE in debug builds:

  /usr/include/features.h:414:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  414 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~

Use it in release builds instead.
parent 88e5f7ec
No related branches found
No related tags found
1 merge request!49Fix warnings that appear when compiling dev branch with gcc-14 in debug mode
Pipeline #45499 passed
...@@ -49,7 +49,6 @@ endif() ...@@ -49,7 +49,6 @@ endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release") if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options("-march=native;-flto") add_compile_options("-march=native;-flto")
elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options("-D_FORTIFY_SOURCE=3") add_compile_options("-D_FORTIFY_SOURCE=3")
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment