[cfe-commits] r81251 - in /cfe/trunk: include/clang/AST/APValue.h lib/AST/APValue.cpp

Douglas Gregor dgregor at apple.com
Tue Sep 8 13:22:38 PDT 2009


On Sep 8, 2009, at 1:16 PM, Mike Stump wrote:

> On Sep 8, 2009, at 12:57 PM, Douglas Gregor wrote:
>> Make sure to access APValue's data via a char array (rather than
>> through an array of void*), so that we don't run afoul of the
>> strict-aliasing rules in C++ 3.10p15.
>
>> Unfortunately, GCC 4.4 still complains about this code.
>
>> -    return *(APSInt*)(void*)Data;
>> +    return *(APSInt*)(char*)Data;
>
> This doesn't match your description.  If you think this access is  
> through a char to ensure this conforms to the standard...  I'd be  
> happy to give you the aliasing rules class...  This is an access  
> through a type of APSInt, which is unrelated to char.


Where do I enroll?

Alternatively, do you see how to eliminate the strict-aliasing  
violations in APValue? I'm clearly missing something.

	- Doug



More information about the cfe-commits mailing list