From 469b6bce613cdf2d8b52baa1b11d00c25ad3a3ad Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 17 Feb 2015 23:28:19 +0000 Subject: [PATCH] clang-cl: Map /wd4996 to -Wno-deprecated-declarations 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! llvm-svn: 229583 --- clang/include/clang/Driver/CLCompatOptions.td | 2 ++ clang/test/Driver/cl-options.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/Driver/CLCompatOptions.td b/clang/include/clang/Driver/CLCompatOptions.td index 74d67cb..c2580d4 100644 --- a/clang/include/clang/Driver/CLCompatOptions.td +++ b/clang/include/clang/Driver/CLCompatOptions.td @@ -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; def _SLASH_wd4005 : CLFlag<"wd4005">, Alias, AliasArgs<["no-macro-redefined"]>; +def _SLASH_wd4996 : CLFlag<"wd4996">, Alias, + AliasArgs<["no-deprecated-declarations"]>; def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">, Alias; def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">, diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index ba717f0..1287017 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -177,9 +177,10 @@ // 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) -- 2.7.4