This doesn't violate strict-aliasing. Things that are compatible types or differ only by the addition of any combination of signed, unsigned, const or volatile are allowed to alias. If you want to know more about strict-aliasing and what it is you can look at my white paper, Understanding C/C++ Strict Aliasing
or – Why won't the #$@##@^% compiler let me do what I need to do!
Patrick
User Profile
Collapse
-
Short answer,
struct either{
T_f32 asf32;
T_u32 asu32;
};
struct either e;
e.asu32=temp_u3 2;
temp_f32=e.asf3 2;
Or you could use memcpy casting each to char * since
a char* can alias anything.
Long answer, http://dbp-consulting.com/StrictAliasing.pdf, a white paper I wrote because this question comes up over and over. It explains...Leave a comment:
No activity results to display
Show More
Leave a comment: