On 11/12/18 11:06, Geert Uytterhoeven wrote:
I was trying with arm32 toolchain and compiler happy. Now tried with Arm64 toolchain, it provides a warning and the below typecast fixed the issue.
if (unlikely(check_add_overflow(bytes, (size_t)offset, &new_bytes)))
Does typecasting to (size_t) fixed the issue in your environment? Please let me know.
That's a side-effect of offset not being loff_t...
check_add_overflow will expect all the params to be of same type, so
changing to loff_t will not help too.
I think that should be fixed first, else you will forget about
removing the cast later
Yes, I agree.
("casts are evil").