From 87a0af7b38aca99d13979fa83baee386fd542e9f 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229583 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/CLCompatOptions.td | 2 ++ test/Driver/cl-options.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/clang/Driver/CLCompatOptions.td b/include/clang/Driver/CLCompatOptions.td index 74d67cb1bd..c2580d4b8f 100644 --- a/include/clang/Driver/CLCompatOptions.td +++ b/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/test/Driver/cl-options.c b/test/Driver/cl-options.c index ba717f0ff4..1287017469 100644 --- a/test/Driver/cl-options.c +++ b/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.40.0