[llvm-commits] [PATCH] RFC: fix some problems in GeneralHash

Meador Inge meadori at gmail.com
Wed Feb 22 07:15:34 PST 2012


On Wed, Feb 22, 2012 at 6:39 AM, Jay Foad <jay.foad at gmail.com> wrote:

> On 22 February 2012 12:27, Chandler Carruth <chandlerc at google.com> wrote:
>> +    // Use memcpy to work around strict aliasing rules.
>>
>> Not work around, this is simply required by the standard... I don't think
>> you need this comment at all actually.
>
> Well, I didn't say it was working around a *bug*, it's just working
> around some rules in the standard that got in the way of a more
> obvious coding.

I agree with Chandler on the contents of the comment, but I think the comment
itself is useful.  "work around" sounds like the strict aliasing rules are wrong
and we are working around their brokenness.  When, in fact, we are
trying to keep
from violating them.  Also, I think some folks might wonder why the
'memcpy' is used
instead of a cast or something (it does look a little odd at first glance).

-- 
# Meador




More information about the llvm-commits mailing list