]> source.dussan.org Git - tigervnc.git/commitdiff
Disable nonliteral format warnings on clang
authorPierre Ossman <ossman@cendio.se>
Tue, 8 Jun 2021 08:14:17 +0000 (10:14 +0200)
committerPierre Ossman <ossman@cendio.se>
Tue, 8 Jun 2021 09:12:24 +0000 (11:12 +0200)
These are incompatible with functions such as gettext() as clang hasn't
implemented the function attribute function_arg.

CMakeLists.txt

index 9f1505e0873d428588cc9ab555e1f375a43acead..1cd1f696116c389e4c37e7896a97df67b04bd430 100644 (file)
@@ -79,6 +79,11 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=vla")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla")
 ENDIF()
+# clang doesn't support format_arg, which breaks this warning
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-nonliteral -Wno-format-security")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-nonliteral -Wno-format-security")
+endif()
 
 option(ENABLE_ASAN "Enable address sanitizer support" OFF)
 if(ENABLE_ASAN AND NOT WIN32 AND NOT APPLE)