]> granicus.if.org Git - clang/commit
Downgrade error about stdcall decls with no prototype to a warning
authorReid Kleckner <reid@kleckner.net>
Wed, 24 Sep 2014 17:49:24 +0000 (17:49 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 24 Sep 2014 17:49:24 +0000 (17:49 +0000)
commit9c4a0f73b4c357fadc794d4e2e2dcc519a88b9a0
treea49a12a386320074d7cf99e57313f93f604165e9
parentf4daa217938a68285ffe697cbf107b0c9e957707
Downgrade error about stdcall decls with no prototype to a warning

Fixes PR21027.  The MIDL compiler produces code that does this.

If we wanted to improve the warning, I think we could do this:
  void __stdcall f(); // Don't warn without -Wstrict-prototypes.
  void g() {
    f(); // Might warn, the user probably meant for f to take no args.
    f(1, 2, 3); // Warn, we have no idea what args f takes.
    f(1); // Error, this is insane, one of these calls is broken.
  }

Reviewers: thakis

Differential Revision: http://reviews.llvm.org/D5481

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218394 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
test/CodeGen/mrtd.c
test/Sema/callingconv.c
test/Sema/decl-microsoft-call-conv.c
test/Sema/stdcall-fastcall.c