Note that adding an explicit u32 cast avoids the problem even with a buggy
compiler:

static inline u32 get_unaligned_le32(const u8 *p)
{
        return (u32)p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}

Generally it's a good idea to write explicit type conversions like in this example. Poor precompiler/optimizer could treat inline just like a macro (which is wrong)

Without that (u32) first conversion in this code is probably not specified so it is defaulted to int.
With a buggy version we probably have:
  ( (int)p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24 )
as a result.

Of course conversion should be found as function return type.

Maybe this will help isolating needed patch.

Best regards.
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to