From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id AE951446439 for ; Tue, 20 Oct 2020 18:40:38 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Tue, 20 Oct 2020 18:40:28 +0300 Message-Id: <97e7b9c46ded980d72b84052afee80f48f9a244c.1603207315.git.avtikhon@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 1/3] build: fix Werror warning in test/unit:fiber*.c* List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin Cc: tarantool-patches@dev.tarantool.org 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: aa78a941430a196e24d146734cd1f64bd9735e4f ("test/uint: fiber") when the test was completely rewritten. Needed for #4941 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4941-gcc-old Issue: https://github.com/tarantool/tarantool/issues/4941 test/unit/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index aace8cf50..e05466473 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -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) -- 2.25.1