1 |
On Fri, 01 Jul 2011 14:53:45 +0300 |
2 |
Nikos Chantziaras <realnc@×××××.de> wrote: |
3 |
|
4 |
> |
5 |
> You can alias them with a char* (a char pointer can alias everything in |
6 |
> a valid and defined manner). What you do is use the char* to scan over |
7 |
> the target type. And since a char is always guaranteed to be 8 bits, |
8 |
> it's very suited for doing endian conversions. |
9 |
> |
10 |
|
11 |
Yes, that's true, but in my case another concern was having data |
12 |
that is more easily human readable. A text file full of single-byte |
13 |
data is harder to read than a file with full 64 or 32 bit strings. |
14 |
|
15 |
For endian conversions, though, the char pointer is recommended. |
16 |
|
17 |
But with the availability of the "-fno-strict-aliasing" option it |
18 |
doesn't seem to matter which method is chosen. |