1 |
On Fri, 01 Jul 2011 02:44:36 +0300 |
2 |
Nikos Chantziaras <realnc@×××××.de> wrote: |
3 |
|
4 |
> >> unsigned long int *px = (unsigned long int*)&x; |
5 |
|
6 |
> And here you can read more thorough information about strict aliasing: |
7 |
> |
8 |
> http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing |
9 |
> |
10 |
|
11 |
Thanks for this link. I can see what's happening now. |
12 |
|
13 |
These types of pointers are admittedly unusual, but it's the only |
14 |
quick way I know to load a double variable with a certain bit pattern, |
15 |
or to convert big/small endian values, etc. I ordinarily don't do these |
16 |
things, but when I do I 'll keep this aliasing in mind. |
17 |
|
18 |
Frank Peters |