]> granicus.if.org Git - clang/commitdiff
clang-cl: Map /wd4996 to -Wno-deprecated-declarations
authorReid Kleckner <reid@kleckner.net>
Tue, 17 Feb 2015 23:28:19 +0000 (23:28 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 17 Feb 2015 23:28:19 +0000 (23:28 +0000)
This is typically used to suppress warnings about calling snprintf and
other "deprecated" POSIX functions. Accepting this flag helps avoid tons
of useless warnings when trying out clang-cl on a new project.

Patch by Scott Graham!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229583 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CLCompatOptions.td
test/Driver/cl-options.c

index 74d67cb1bdc58a21a1e3465e1a8f7fece7eab71b..c2580d4b8fcb791c735bc84e36e5454ae0975326 100644 (file)
@@ -130,6 +130,8 @@ def _SLASH_WX_ : CLFlag<"WX-">, HelpText<"Do not treat warnings as errors">,
 def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
 def _SLASH_wd4005 : CLFlag<"wd4005">, Alias<W_Joined>,
   AliasArgs<["no-macro-redefined"]>;
+def _SLASH_wd4996 : CLFlag<"wd4996">, Alias<W_Joined>,
+  AliasArgs<["no-deprecated-declarations"]>;
 def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
   Alias<vtordisp_mode_EQ>;
 def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">,
index ba717f0ff4c829fd513f9e2eb0a3693a6566ae6d..1287017469ddb9546941336953aa99c1338d8f66 100644 (file)
 // NOSTRICT: "-relaxed-aliasing"
 
 // For some warning ids, we can map from MSVC warning to Clang warning.
-// RUN: %clang_cl -wd4005 -### -- %s 2>&1 | FileCheck -check-prefix=wd4005 %s
-// wd4005: "-cc1"
-// wd4005: "-Wno-macro-redefined"
+// RUN: %clang_cl -wd4005 -wd4996 -### -- %s 2>&1 | FileCheck -check-prefix=Wno %s
+// Wno: "-cc1"
+// Wno: "-Wno-macro-redefined"
+// Wno: "-Wno-deprecated-declarations"
 
 // Ignored options. Check that we don't get "unused during compilation" errors.
 // (/Zs is for syntax-only)