[PATCH] D65859: [LLVM][Alignment] Fix MSVC warning

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 06:20:53 PDT 2019


RKSimon updated this revision to Diff 215381.
RKSimon added a comment.

Disable MSVC divide by zero warnings for the whole of AlignmentTest.cpp


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65859/new/

https://reviews.llvm.org/D65859

Files:
  unittests/Support/AlignmentTest.cpp


Index: unittests/Support/AlignmentTest.cpp
===================================================================
--- unittests/Support/AlignmentTest.cpp
+++ unittests/Support/AlignmentTest.cpp
@@ -11,6 +11,12 @@
 
 #include <vector>
 
+#ifdef _MSC_VER
+// Disable warnings about potential divide by 0.
+#pragma warning(push)
+#pragma warning(disable : 4723)
+#endif
+
 using namespace llvm;
 
 namespace {
@@ -298,3 +304,7 @@
 #endif // NDEBUG
 
 } // end anonymous namespace
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65859.215381.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190815/334e6f22/attachment.bin>


More information about the llvm-commits mailing list