
In message 4731ECA0.1010502@schweigstill.de you wrote:
Wolfgang Denk schrieb:
Oops? I can't parse that. What's the difference between "signed char" and "int" except the number of bits?
Like mentioned before, accessing data via a (signed|unsigned|.) char * is independant of the processor endianess. If you want to read a
Correct. And storing the result in an "int" type is independent of the byte order as well,if you do it right.
bitstream which is bytewise formatted you don't want to care about endianess. Or do you also want some endianess string definitions?
What has this to do with what we're discussing?
And it is even worse; on some architectures, like ARM, it is not allowed to do a 16/32 bit memory access on a non-aligned address, e.g.:
Nobody intended to do that.
int val; int * p_data;
STOP! I asked why we cannot change "val" into an "int". I never said anything about using an "int *" to access to buffer data.
Depending of the ARM implementation you either get a data abort or an "implementation depending" wrong value in val. For write access it is even worse because this can overwrite some memory.
This bug is your invention, not mine.
Best regards,
Wolfgang Denk