aboutsummaryrefslogtreecommitdiffstats
path: root/lib/builtins/udivmoddi4.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/builtins/udivmoddi4.c')
-rw-r--r--lib/builtins/udivmoddi4.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/builtins/udivmoddi4.c b/lib/builtins/udivmoddi4.c
index 2914cc0fb46d..5b297c32d790 100644
--- a/lib/builtins/udivmoddi4.c
+++ b/lib/builtins/udivmoddi4.c
@@ -17,6 +17,13 @@
// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide
+#if defined(_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_int a, du_int b, du_int *rem) {
*rem = r.all;
return q.all;
}
+
+#if defined(_MSC_VER) && !defined(__clang__)
+#pragma warning(pop)
+#endif