[PATCH] Don't trap when passing non-POD arguments to variadic functions in MS-compatibility mode

Hans Wennborg hans at chromium.org
Thu Sep 25 09:58:09 PDT 2014


Hi rnk, rsmith,

Clang warns (treated as error by default, but still ignored in system headers) when passing non-POD arguments to variadic functions, and generates a trap instruction to crash the program if that code is ever run.

Unfortunately, MSVC happily generates code for such calls without a warning, and there is code in system headers that use it.

This patch makes Clang not insert the trap instruction when in -fms-compatibility mode, while still generating the warning/error message.

http://reviews.llvm.org/D5492

Files:
  lib/Sema/SemaExpr.cpp
  test/CodeGenCXX/vararg-non-pod-ms-compat.cpp
  test/SemaCXX/vararg-non-pod.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5492.14077.patch
Type: text/x-patch
Size: 1785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140925/389809be/attachment.bin>


More information about the cfe-commits mailing list