Closed cjacek closed 7 months ago
@ctruta: I'll supply a PR which removes the offensive (compilist) code and works without the enormous complexity of the suggested change.
Fix is in #540; same code but make the mask a (png_alloc_size_t) not an (unsigned) so that PR does actually fix a bug on 16-bit systems.
Thanks!
This fixes a warning on Clang with MSVC target. In this case, clang defines
_MSC_VER
, not__GNUC__
, but it's still a subject to the same warning. I could change the condition ofpng_gt
to something likedefined(__GNUC__) || defined(__clang__)
, but we could also simplify things by adding a pointer size check. This way, the problematic tautological gt expression is entirely skipped by the compiler by constant folding the first expression.I noticed it in a build of the version bundled in Wine, the patch avoids the warning both on GCC and Clang (both in GNUC and MSVC modes).