From: Kefu Chai Date: Wed, 17 Mar 2021 12:03:45 +0000 (+0800) Subject: cmake: do not pass -fpermissive when compiling C code X-Git-Tag: v17.1.0~2586^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=93d22b6795c3f8719c74ab255ef2516222f774ef;p=ceph.git cmake: do not pass -fpermissive when compiling C code silences warnings like [2/768] /usr/bin/x86_64-w64-mingw32-gcc-posix -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_POSIX=1 -D_POSIX_=1 -D_POSIX_C_SOURCE=1 -D_POSIX_THREADS=1 -D_REENTRANT -D_THREAD_SAFE -D_WIN32_WINNT=0x0A00 -D__CEPH__ -D__STDC_FORMAT_MACROS -Isrc/include -I../src -I../src/include/win32 -isystem ../build.deps/mingw/boost/include -isystem include -isystem ../src/xxHash -isystem ../src/rapidjson/include -isystem ../src/fmt/include -O3 -DNDEBUG -include winsock_wrapper.h -include win32_errno.h -U_FORTIFY_SOURCE -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -fpermissive -fdiagnostics-color=auto -std=gnu99 -MD -MT src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj -MF src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj.d -o src/CMakeFiles/common-objs.dir/xxHash/xxhash.c.obj -c ../src/xxHash/xxhash.c cc1: warning: command line option '-fpermissive' is valid for C++/ObjC++ but not for C see also https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/C_002b_002b-Dialect-Options.html Signed-off-by: Kefu Chai --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fe93590cb4c50..bb139e25f4c6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,7 +64,7 @@ endif() if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) if(MINGW) # The MINGW headers are missing some "const" qualifiers. - add_compile_options($<$,$>:-fpermissive>) + add_compile_options($<$:-fpermissive>) else() string(APPEND CMAKE_EXE_LINKER_FLAGS " -rdynamic") endif()