File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
38
38
list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-xc++" )
39
39
endif ()
40
40
41
+ # We should avoid non-literals in format strings, or appropriately mark
42
+ # functions.
43
+ check_cxx_compiler_flag ("-Wformat-nonliteral -Werror=format-nonliteral" CXX_SUPPORTS_FORMAT_NONLITERAL_WARNING )
44
+ if (CXX_SUPPORTS_FORMAT_NONLITERAL_WARNING )
45
+ list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-Wformat-nonliteral"
46
+ "-Werror=format-nonliteral" )
47
+ endif ()
48
+
41
49
# C++ code in the runtime and standard library should generally avoid
42
50
# introducing static constructors or destructors.
43
51
check_cxx_compiler_flag ("-Wglobal-constructors -Werror=global-constructors" CXX_SUPPORTS_GLOBAL_CONSTRUCTORS_WARNING )
You can’t perform that action at this time.
0 commit comments