<div dir="ltr"><div><span style="font-family:arial,sans-serif;font-size:13px">C11 </span><font face="arial, sans-serif">6.3.2.3p7:</font><br></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned for the referenced type, the behavior is undefined.<br></font></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 21, 2014 at 2:17 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2014 Sep 21, at 05:25, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
><br>
> C++ requires that pointers point to sufficiently well aligned addresses.<br>
<br>
</span>I thought this only applied to allocated memory.<br>
<span class=""><br>
> getEmptyKey() and getTombstoneKey() would cast -1 and -2 to arbitrary<br>
> pointer types which would violate this requirement.<br>
<br>
</span>What part of the standard labels this undefined behaviour?  I can't<br>
find it.<br>
</blockquote></div><br></div>