[llvm] r235219 - Suppressing the C4324 warnings generated by MSVC. This is the only declarative instance that would generate the warning, but it accounted for about 525+ warnings due to template instantiations. This is a marginal-value warning which we may decide to disable more broadly, but since this header is in Support and may be used out of tree, it's a low burden for us to be warning-free in this case.

Aaron Ballman aaron at aaronballman.com
Fri Apr 17 12:35:44 PDT 2015


Author: aaronballman
Date: Fri Apr 17 14:35:44 2015
New Revision: 235219

URL: http://llvm.org/viewvc/llvm-project?rev=235219&view=rev
Log:
Suppressing the C4324 warnings generated by MSVC. This is the only declarative instance that would generate the warning, but it accounted for about 525+ warnings due to template instantiations. This is a marginal-value warning which we may decide to disable more broadly, but since this header is in Support and may be used out of tree, it's a low burden for us to be warning-free in this case.

Modified:
    llvm/trunk/include/llvm/Support/AlignOf.h

Modified: llvm/trunk/include/llvm/Support/AlignOf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/AlignOf.h?rev=235219&r1=235218&r2=235219&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/AlignOf.h (original)
+++ llvm/trunk/include/llvm/Support/AlignOf.h Fri Apr 17 14:35:44 2015
@@ -22,6 +22,11 @@ namespace llvm {
 template <typename T>
 struct AlignmentCalcImpl {
   char x;
+#if defined(_MSC_VER)
+// Disables "structure was padded due to __declspec(align())" warnings that are
+// generated by any class using AlignOf<T> with a manually specified alignment.
+#pragma warning(suppress : 4324)
+#endif
   T t;
 private:
   AlignmentCalcImpl() {} // Never instantiate.





More information about the llvm-commits mailing list