There is a bug in egcs (including 1.1.2), which is triggered on
little-endian targets with constructs like
short var = 0;
*((char *) &var) = value;
if var is stored in a register and optimization is enabled. Then not only the
lowpart of this register is changed, but the whole register.
The problem is fixed in recent snapshots of egcs.
A workaround for the checksum problem could be
if (nleft == 1) {
#if __BYTE_ORDER == __LITTLE_ENDIAN
sum += *(u_char *)w;
#else
*(u_char *)(&answer) = *(u_char *)w ;
sum += answer;
#endif
}
Lars
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/