[PATCH] ADT: Remove misaligned pointeres from DenseMapInfo
Duncan P. N. Exon Smith
dexonsmith at apple.com
Sun Sep 21 14:54:20 PDT 2014
> On 2014 Sep 21, at 14:41, David Majnemer <david.majnemer at gmail.com> wrote:
>
> C11 6.3.2.3p7:
>
> 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.
-1 is an integer, not a pointer, so I'm not sure p7 is relevant. p5
does look relevant, and it doesn't call this out as UB:
C11 6.3.2.3p5:
An integer may be converted to any pointer type. Except as
previously specified, the result is implementation-defined, might
not be correctly aligned, might not point to an entity of the
referenced type, and might be a trap representation.
More information about the llvm-commits
mailing list