src/socket_wrapper.c: implement recvmmsg and sendmmsg
[socket_wrapper.git] / CompilerChecks.cmake
index 5e9d8301ece9ed8b77b960cffe1a56776745c771..8d18fbfcf2ef2e55b56a3e151a99687ad18d7835 100644 (file)
@@ -22,7 +22,7 @@ if (UNIX)
     add_c_compiler_flag("-Wshadow" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wmissing-prototypes" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wcast-align" SUPPORTED_COMPILER_FLAGS)
-    #add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS)
+    add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=address" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wstrict-prototypes" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=strict-prototypes" SUPPORTED_COMPILER_FLAGS)
@@ -38,8 +38,11 @@ if (UNIX)
     add_c_compiler_flag("-Wuninitialized" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=uninitialized" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wimplicit-fallthrough" SUPPORTED_COMPILER_FLAGS)
-    add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
-    add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
+    # FIXME: We can't use this as there is a glibc bug in socket.h
+    # https://bugzilla.redhat.com/show_bug.cgi?id=2047022
+    # https://sourceware.org/bugzilla/show_bug.cgi?id=28846
+    #add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
+    #add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wno-format-zero-length" SUPPORTED_COMPILER_FLAGS)
 
     check_c_compiler_flag("-Wformat" REQUIRED_FLAGS_WFORMAT)
@@ -106,5 +109,9 @@ if (MSVC)
     add_c_compiler_flag("/D _CRT_SECURE_NO_WARNINGS=1" SUPPORTED_COMPILER_FLAGS)
 endif()
 
-set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE)
-set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE)
+if (SUPPORTED_COMPILER_FLAGS)
+    set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE)
+endif()
+if (SUPPORTED_LINKER_FLAGS)
+    set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE)
+endif()