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")
3838 list (APPEND SWIFT_RUNTIME_CORE_CXX_FLAGS "-xc++" )
3939endif ()
4040
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+
4149# C++ code in the runtime and standard library should generally avoid
4250# introducing static constructors or destructors.
4351check_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