From 68e3aa7f302459b0ae1b3327a08ed3ad73e2c04c Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 11 May 2016 00:49:20 +0000 Subject: Disable -Wcast-calling-convention by default (follow-up to r269116) llvm-svn: 269148 --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 +- clang/test/Sema/callingconv-cast.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 906328d4de6..4da2d28905b 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -6625,7 +6625,7 @@ def warn_function_def_in_objc_container : Warning< def warn_cast_calling_conv : Warning< "cast between incompatible calling conventions '%0' and '%1'; " "calls through this pointer may abort at runtime">, - InGroup>; + InGroup>, DefaultIgnore; def note_change_calling_conv_fixit : Note< "consider defining %0 with the '%1' calling convention">; def warn_bad_function_cast : Warning< diff --git a/clang/test/Sema/callingconv-cast.c b/clang/test/Sema/callingconv-cast.c index 60dee6fc540..9f1855baeb5 100644 --- a/clang/test/Sema/callingconv-cast.c +++ b/clang/test/Sema/callingconv-cast.c @@ -3,6 +3,9 @@ // RUN: %clang_cc1 -fms-extensions -triple i686-pc-windows-msvc -Wcast-calling-convention -DMSVC -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefix=MSFIXIT // RUN: %clang_cc1 -triple i686-pc-windows-gnu -Wcast-calling-convention -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s --check-prefix=GNUFIXIT +// Check that the warning is disabled by default: +// RUN: %clang_cc1 -fms-extensions -triple i686-pc-windows-msvc -DMSVC -Werror -Wno-pointer-bool-conversion -x c %s + // expected-note@+1 {{consider defining 'mismatched_before_winapi' with the 'stdcall' calling convention}} void mismatched_before_winapi(int x) {} @@ -43,12 +46,12 @@ int main() { take_callback((callback_t)(void*)mismatched); } -// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{7:6-7:6}:"__stdcall " +// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// MSFIXIT: fix-it:"{{.*}}callingconv-cast.c":{10:6-10:6}:"__stdcall " -// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{16:6-16:6}:"WINAPI " -// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{7:6-7:6}:"__attribute__((stdcall)) " +// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{19:6-19:6}:"WINAPI " +// GNUFIXIT: fix-it:"{{.*}}callingconv-cast.c":{10:6-10:6}:"__attribute__((stdcall)) " -- cgit v1.2.3