Anton Khirnov (12020-05-21): > This is wrong. We should not fix warnings, we should fix bugs. Warnings > suggest there may be a bug, but not all warnings are correct. > > In this case, I believe the warnings is invalid and there is no problem > to fix. It's correct that the comparison is always false on some > platforms, but AFAIK no standard we adhere to guarantees that on all > platforms.
Yet, we should strive to silence this warning, because invalid warnings distract from valid ones. It is tricky to do elegantly. Maybe: static inline int check_overflow(size_t n, size_t s, size_t c) { return n <= SIZE_MAX / s && n * s < SIZE_MAX - c; } It would avoid the warning because n is size_t instead of unsigned. Regards, -- Nicolas George
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".