[compiler-rt] r368476 - [sanitizers] MSVC warning disable for clean build
Matthew G McGovern via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 13:09:47 PDT 2019
Author: mcgov
Date: Fri Aug 9 13:09:46 2019
New Revision: 368476
URL: http://llvm.org/viewvc/llvm-project?rev=368476&view=rev
Log:
[sanitizers] MSVC warning disable for clean build
- https://reviews.llvm.org/D66023
Modified:
compiler-rt/trunk/lib/builtins/emutls.c
compiler-rt/trunk/lib/builtins/fixunsxfdi.c
compiler-rt/trunk/lib/builtins/fixunsxfsi.c
compiler-rt/trunk/lib/builtins/fixxfdi.c
compiler-rt/trunk/lib/builtins/udivmoddi4.c
Modified: compiler-rt/trunk/lib/builtins/emutls.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/emutls.c?rev=368476&r1=368475&r2=368476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/emutls.c (original)
+++ compiler-rt/trunk/lib/builtins/emutls.c Fri Aug 9 13:09:46 2019
@@ -26,12 +26,23 @@
#define EMUTLS_SKIP_DESTRUCTOR_ROUNDS 0
#endif
+#ifdef _MSC_VER && !defined(__clang__)
+// MSVC raises a warning about a nonstandard extension being used for the 0
+// sized element in this array. Disable this for warn-as-error builds.
+#pragma warning(push)
+#pragma warning(disable : 4206)
+#endif
+
typedef struct emutls_address_array {
uintptr_t skip_destructor_rounds;
uintptr_t size; // number of elements in the 'data' array
void *data[];
} emutls_address_array;
+#ifdef _MSC_VER && !defined(__clang__)
+#pragma warning(pop)
+#endif
+
static void emutls_shutdown(emutls_address_array *array);
#ifndef _WIN32
Modified: compiler-rt/trunk/lib/builtins/fixunsxfdi.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/fixunsxfdi.c?rev=368476&r1=368475&r2=368476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/fixunsxfdi.c (original)
+++ compiler-rt/trunk/lib/builtins/fixunsxfdi.c Fri Aug 9 13:09:46 2019
@@ -25,6 +25,13 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm
+#ifdef _MSC_VER && !defined(__clang__)
+// MSVC throws a warning about 'unitialized variable use' here,
+// disable it for builds that warn-as-error
+#pragma warning(push)
+#pragma warning(disable : 4700)
+#endif
+
COMPILER_RT_ABI du_int __fixunsxfdi(long double a) {
long_double_bits fb;
fb.f = a;
@@ -36,4 +43,6 @@ COMPILER_RT_ABI du_int __fixunsxfdi(long
return fb.u.low.all >> (63 - e);
}
+#ifdef _MSC_VER && !defined(__clang__)
+#pragma warning(pop)
#endif
Modified: compiler-rt/trunk/lib/builtins/fixunsxfsi.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/fixunsxfsi.c?rev=368476&r1=368475&r2=368476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/fixunsxfsi.c (original)
+++ compiler-rt/trunk/lib/builtins/fixunsxfsi.c Fri Aug 9 13:09:46 2019
@@ -25,6 +25,13 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm
+#ifdef _MSC_VER && !defined(__clang__)
+// MSVC throws a warning about 'unitialized variable use' here,
+// disable it for builds that warn-as-error
+#pragma warning(push)
+#pragma warning(disable : 4700)
+#endif
+
COMPILER_RT_ABI su_int __fixunsxfsi(long double a) {
long_double_bits fb;
fb.f = a;
@@ -36,4 +43,8 @@ COMPILER_RT_ABI su_int __fixunsxfsi(long
return fb.u.low.s.high >> (31 - e);
}
+#ifdef _MSC_VER && !defined(__clang__)
+#pragma warning(pop)
+#endif
+
#endif // !_ARCH_PPC
Modified: compiler-rt/trunk/lib/builtins/fixxfdi.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/fixxfdi.c?rev=368476&r1=368475&r2=368476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/fixxfdi.c (original)
+++ compiler-rt/trunk/lib/builtins/fixxfdi.c Fri Aug 9 13:09:46 2019
@@ -24,6 +24,13 @@
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
// mmmm mmmm mmmm
+#ifdef _MSC_VER && !defined(__clang__)
+// MSVC throws a warning about 'unitialized variable use' here,
+// disable it for builds that warn-as-error
+#pragma warning(push)
+#pragma warning(disable : 4700)
+#endif
+
COMPILER_RT_ABI di_int __fixxfdi(long double a) {
const di_int di_max = (di_int)((~(du_int)0) / 2);
const di_int di_min = -di_max - 1;
@@ -40,4 +47,8 @@ COMPILER_RT_ABI di_int __fixxfdi(long do
return (r ^ s) - s;
}
+#ifdef _MSC_VER && !defined(__clang__)
+#pragma warning(pop)
+#endif
+
#endif // !_ARCH_PPC
Modified: compiler-rt/trunk/lib/builtins/udivmoddi4.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/udivmoddi4.c?rev=368476&r1=368475&r2=368476&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/udivmoddi4.c (original)
+++ compiler-rt/trunk/lib/builtins/udivmoddi4.c Fri Aug 9 13:09:46 2019
@@ -17,6 +17,13 @@
// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide
+#ifdef _MSC_VER && !defined(__clang__)
+// MSVC throws a warning about mod 0 here, disable it for builds that
+// warn-as-error
+#pragma warning(push)
+#pragma warning(disable : 4724)
+#endif
+
COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT;
const unsigned n_udword_bits = sizeof(du_int) * CHAR_BIT;
@@ -187,3 +194,7 @@ COMPILER_RT_ABI du_int __udivmoddi4(du_i
*rem = r.all;
return q.all;
}
+
+#ifdef _MSC_VER && !defined(__clang__)
+#pragma warning(pop)
+#endif
\ No newline at end of file
More information about the llvm-commits
mailing list