Skip to content
Snippets Groups Projects
Commit 6b3ed663 authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

build: fix Werror warning in test/unit:fiber*.c*

Building with gcc-4.8.5 on CentOS 7 found issue:

cd /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit && /usr/bin/g++ ... -Wp,-D_FORTIFY_SOURCE=2 ... -O2 ... -O0 -o CMakeFiles/fiber.test.dir/fiber.cc.o -c /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit/fiber.cc
In file included from /usr/include/inttypes.h:25:0,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/src/lib/small/small/region.h:34,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/src/lib/core/memory.h:33,
                 from /source/build/usr/src/debug/tarantool-2.6.0.144/test/unit/fiber.cc:1:
/usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
 # warning _FORTIFY_SOURCE requires compiling with optimization (-O)

It happened because _FORTIFY_SOURCE=2 flag needed -O[1|2] optimization,
but latest set in command was -O0. To fix it removed not needed '-O0'
optimization from test/unit/CmakeLists.txt file. This optimization
became unneeded after the commit:

  aa78a941 ("test/uint: fiber")

when the test was completely rewritten.

Needed for #4941
parent 8a0d45f2
No related branches found
No related tags found
No related merge requests found
......@@ -75,13 +75,9 @@ add_executable(decimal.test decimal.c)
target_link_libraries(decimal.test core unit)
add_executable(mp_error.test mp_error.cc core_test_utils.c)
target_link_libraries(mp_error.test box_error core unit)
add_executable(fiber.test fiber.cc core_test_utils.c)
set_source_files_properties(fiber.cc PROPERTIES COMPILE_FLAGS -O0)
target_link_libraries(fiber.test core unit)
add_executable(fiber_stack.test fiber_stack.c core_test_utils.c)
set_source_files_properties(fiber_stack.c PROPERTIES COMPILE_FLAGS -O0)
target_link_libraries(fiber_stack.test core unit)
if (NOT ENABLE_GCOV)
......
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