<div dir="rtl"><div dir="ltr">This LGTM, with #ifdef _MSC_VER macro of course, maybe in Compiler.h ?</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">I wouldn't mind disabling the warning completely either, I don't find it helpful.<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-04-16 18:12 GMT+03:00 Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Since AlignOf is part of our support headers, I would slightly prefer<br>
if we could fix it there. As an experiment, I put in the proper<br>
#pragma incantation around the declaration of AlignmentCalcImpl<T> in<br>
AlignOf.h, and it resolved *all* of the warnings.<br>
<br>
#pragma warning(push)<br>
#pragma warning(disable : 4324)<br>
template <typename T><br>
struct AlignmentCalcImpl {<br>
  char x;<br>
  T t;<br>
private:<br>
  AlignmentCalcImpl() {} // Never instantiate.<br>
};<br>
#pragma warning(pop)<br>
<br>
<br>
While the #pragma dance is ugly (and would need to be abstracted away<br>
via macros), it may be worth it since this is a support header (and we<br>
cannot fix the padding issue because that's the whole point to that<br>
structure). How do others feel?<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Apr 16, 2015 at 10:49 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
> /W3 was probably cached from the previous build.<br>
><br>
> So should we disable C4324 or fix (how?) the AlignOf?<br>
><br>
><br>
> 2015-04-16 17:34 GMT+03:00 Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>>:<br>
>><br>
>> It seems that in order to trigger this, you have to have done a clean<br>
>> cmake build, as I am now seeing the same warnings you are.<br>
>><br>
>> ~Aaron<br>
>><br>
>> On Thu, Apr 16, 2015 at 10:16 AM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
>> wrote:<br>
>> > On Thu, Apr 16, 2015 at 10:03 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>><br>
>> > wrote:<br>
>> >> It is same in the IDE and command line, Release or Debug (unthreaded),<br>
>> >> 32<br>
>> >> bit.<br>
>> >> The warning is:<br>
>> >><br>
>> >>   PPMacroExpansion.cpp<br>
>> >> c:\llvm\include\llvm/Support/AlignOf.h(25): warning C4324:<br>
>> >> 'llvm::AlignmentCalcImpl<T>' : structure was padded due to<br>
>> >> __declspec(align()) [c:\llvm\msvc\tools\clang\lib\Lex\clangLex.vcxproj]<br>
>> >>           with<br>
>> >>           [<br>
>> >>               T=clang::SrcMgr::ContentCache<br>
>> >>           ] (c:\llvm\tools\clang\lib\Lex\PPCaching.cpp)<br>
>> >>           c:\llvm\include\llvm/Support/AlignOf.h(40) : see reference to<br>
>> >> class template instantiation 'llvm::AlignmentC<br>
>> >>   alcImpl<T>' being compiled<br>
>> >>           with<br>
>> >>           [<br>
>> >>               T=clang::SrcMgr::ContentCache<br>
>> >>           ]<br>
>> >>           c:\llvm\tools\clang\include\clang/Basic/SourceManager.h(225)<br>
>> >> : see<br>
>> >> reference to class template instantiation<br>
>> >>    'llvm::AlignOf<clang::SrcMgr::ContentCache>' being compiled<br>
>> >><br>
>> >> referring to SourceManager.h(225):<br>
>> >><br>
>> >>   static_assert(llvm::AlignOf<ContentCache>::Alignment >= 8,<br>
>> >>                 "ContentCache must be 8-byte aligned.");<br>
>> >><br>
>> >> And appears whenever SourceManager.h is included, a lot.<br>
>> >><br>
>> >> The compiler is Microsoft Visual Studio Ultimate 2013,  Version<br>
>> >> 12.0.31101.00 Update 4.<br>
>> >><br>
>> >> I'll try threaded build now.<br>
>> ><br>
>> > I will do a clean rebuild from scratch; I wonder if the reason I'm not<br>
>> > seeing anything is because of some caching somewhere. Thank you!<br>
>> ><br>
>> > ~Aaron<br>
><br>
><br>
</div></div></blockquote></div><br></div>