So, as left operand is 8bit, the right operant must not be over 8.
Does a simple typecast solves it?
return (u32)((u32)p[0] | (u32)p[1] << 8 | (u32)p[2] << 16 | (u32)p[3]
<< 24);
return (u32)p[0] | (u32)p[1] << 8 | (u32)p[2] << 16 | (u32)p[3] << 24;
is correct for all compilers, and this version should be used
anyway
return (u32)p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
is fair enough, because in gcc default typecast tights to the left
expression in maths
and also in gcc this typecast SHOULD default to return type,
but does not in some versions as we can see here
best regards
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel