<div dir="ltr">Generally it is preferable to store bitfields using plain integer types because MSVC has surprising behavior when packing bitfields of differing type. MSVC, for example, will not back this into one byte:<div> bool a : 1;</div><div> uint8_t b : 2;</div><div> bool c : 1;</div><div>So, for LLVM or any other cross platform project, I recommend storing enums as some integer type, using the same type for all bitfields, and adding accessors to do the casts.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 31, 2019 at 12:40 PM Lang Hames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Denis,<div><br></div><div>It is unfortunate that GCC has added such an aggressive warning with no way to disable it. I would definitely make a comment on their bug tracker that you have hit this.<div><br></div><div>We could work around this by changing the field type to uint8_t and adding casts, but I'm not sure whether we want to work around warnings in other compilers as a matter of policy.</div><div><br></div><div>Anyone else have thoughts on style here?</div><div><br></div><div>Cheers,</div><div>Lang.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 31, 2019 at 10:54 AM Bakhvalov, Denis <<a href="mailto:denis.bakhvalov@intel.com" target="_blank">denis.bakhvalov@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="PL">
<div class="gmail-m_9440196924342169gmail-m_-4550326604326089841WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<br>
<br>
After commit 93af05e03e05d2f85b5a7e20ec3a3a543584d84f we have new warning but only if compiled with GCC:<br>
<br>
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">In file included from /path/to/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:19:0,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> from /path/to/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h:23,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> from /path/to/llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.cpp:9:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">/path/to/llvm/include/llvm/ExecutionEngine/Orc/Core.h:690:25: warning: ‘llvm::orc::JITDylib::SymbolTableEntry::State’ is too small to hold all values of ‘enum class llvm::orc::JITDylib::SymbolState’<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> SymbolState State : 6;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">There is no GCC option for disabling this warning:
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414" target="_blank"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:rgb(3,102,214);background-color:white;text-decoration:none">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The issue is that now LLVM is not buildable with GCC and ‘-Werror’ enabled.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">In addition, LLVM gcc-werror buildbot seems to be offline since May 9th:<br>
<a href="http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror" target="_blank">http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I understand that changing the code to satisfy GCC requirements might not be desired, but I think this is something that we should do.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<br>
Denis Bakhvalov.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>
</blockquote></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>