Skip to content

Commit 4e6f406

Browse files
committed
[builtins] MSVC warning disable for clean build
- https://reviews.llvm.org/D66023 - amended for ifdef/if gcc errors in previous verison git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368598 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 0b161aa commit 4e6f406

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

lib/builtins/emutls.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,23 @@
2626
#define EMUTLS_SKIP_DESTRUCTOR_ROUNDS 0
2727
#endif
2828

29+
#if defined(_MSC_VER) && !defined(__clang__)
30+
// MSVC raises a warning about a nonstandard extension being used for the 0
31+
// sized element in this array. Disable this for warn-as-error builds.
32+
#pragma warning(push)
33+
#pragma warning(disable : 4206)
34+
#endif
35+
2936
typedef struct emutls_address_array {
3037
uintptr_t skip_destructor_rounds;
3138
uintptr_t size; // number of elements in the 'data' array
3239
void *data[];
3340
} emutls_address_array;
3441

42+
#if defined(_MSC_VER) && !defined(__clang__)
43+
#pragma warning(pop)
44+
#endif
45+
3546
static void emutls_shutdown(emutls_address_array *array);
3647

3748
#ifndef _WIN32

lib/builtins/fixunsxfdi.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
2626
// mmmm mmmm mmmm
2727

28+
#if defined(_MSC_VER) && !defined(__clang__)
29+
// MSVC throws a warning about 'unitialized variable use' here,
30+
// disable it for builds that warn-as-error
31+
#pragma warning(push)
32+
#pragma warning(disable : 4700)
33+
#endif
34+
2835
COMPILER_RT_ABI du_int __fixunsxfdi(long double a) {
2936
long_double_bits fb;
3037
fb.f = a;
@@ -36,4 +43,8 @@ COMPILER_RT_ABI du_int __fixunsxfdi(long double a) {
3643
return fb.u.low.all >> (63 - e);
3744
}
3845

46+
#if defined(_MSC_VER) && !defined(__clang__)
47+
#pragma warning(pop)
3948
#endif
49+
50+
#endif //!_ARCH_PPC

lib/builtins/fixunsxfsi.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
2626
// mmmm mmmm mmmm
2727

28+
#if defined(_MSC_VER) && !defined(__clang__)
29+
// MSVC throws a warning about 'unitialized variable use' here,
30+
// disable it for builds that warn-as-error
31+
#pragma warning(push)
32+
#pragma warning(disable : 4700)
33+
#endif
34+
2835
COMPILER_RT_ABI su_int __fixunsxfsi(long double a) {
2936
long_double_bits fb;
3037
fb.f = a;
@@ -36,4 +43,8 @@ COMPILER_RT_ABI su_int __fixunsxfsi(long double a) {
3643
return fb.u.low.s.high >> (31 - e);
3744
}
3845

46+
#if defined(_MSC_VER) && !defined(__clang__)
47+
#pragma warning(pop)
48+
#endif
49+
3950
#endif // !_ARCH_PPC

lib/builtins/fixxfdi.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm
2525
// mmmm mmmm mmmm
2626

27+
#if defined(_MSC_VER) && !defined(__clang__)
28+
// MSVC throws a warning about 'unitialized variable use' here,
29+
// disable it for builds that warn-as-error
30+
#pragma warning(push)
31+
#pragma warning(disable : 4700)
32+
#endif
33+
2734
COMPILER_RT_ABI di_int __fixxfdi(long double a) {
2835
const di_int di_max = (di_int)((~(du_int)0) / 2);
2936
const di_int di_min = -di_max - 1;
@@ -40,4 +47,8 @@ COMPILER_RT_ABI di_int __fixxfdi(long double a) {
4047
return (r ^ s) - s;
4148
}
4249

50+
#if defined(_MSC_VER) && !defined(__clang__)
51+
#pragma warning(pop)
52+
#endif
53+
4354
#endif // !_ARCH_PPC

lib/builtins/udivmoddi4.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717

1818
// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide
1919

20+
#if defined(_MSC_VER) && !defined(__clang__)
21+
// MSVC throws a warning about mod 0 here, disable it for builds that
22+
// warn-as-error
23+
#pragma warning(push)
24+
#pragma warning(disable : 4724)
25+
#endif
26+
2027
COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
2128
const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT;
2229
const unsigned n_udword_bits = sizeof(du_int) * CHAR_BIT;
@@ -187,3 +194,7 @@ COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int *rem) {
187194
*rem = r.all;
188195
return q.all;
189196
}
197+
198+
#if defined(_MSC_VER) && !defined(__clang__)
199+
#pragma warning(pop)
200+
#endif

0 commit comments

Comments
 (0)