<div dir="ltr">I believe C says you can't have one. Every variable must have a distinct address. I don't know what LLVM IR says, but you could maybe insert an asm label.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 17, 2018 at 3:58 AM, David Chisnall via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello the list,<br>
<br>
What is the correct type for a global of size zero?  I need the compiler to be able to generate one, so that the linker will insert it at a specific position without perturbing the location of anything else in the section.  I have tried a zero-length array (generates something at least one byte).  At Nuno’s suggestion, I tried a structure with no fields.  In release builds, this works correctly, but in debug builds it triggers an assertion that the type must be sized.<br>
<br>
What is the recommended way of doing this?<br>
<br>
David<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>