kuba-- / zip

A portable, simple zip library written in C
MIT License
1.39k stars 272 forks source link

C++ compile error implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'mz_uint' (aka 'unsigned int') [-Wshorten-64-to-32] #353

Closed sy6sy2 closed 4 weeks ago

sy6sy2 commented 4 weeks ago

Hello,

I use this library in a C++ project but I'm unable to compile my project on macOS using Xcode + LLVM/Clang version 18.1.8.

This is what I have during the compilation:

XXXXXXXXXXXXXX/extern/zip/src/zip.c:479:49: fatal error: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'mz_uint' (aka 'unsigned int') [-Wshorten-64-to-32]
  479 |     if (!mz_zip_reader_file_stat(&zip->archive, i, &file_stat)) {
      |          ~~~~~~~~~~~~~~~~~~~~~~~                ^
1 error generated.

Maybe I can do something with the shorten-64-to-32 warning?

Thank you for the help!

kuba-- commented 4 weeks ago

Should be fixed on master - PTAL.

sy6sy2 commented 4 weeks ago

I can confirm, it's ok now! Thank you for this quick fix!

Wiilf commented 1 week ago

Pelles C 12:

Building main.res.
Building zip.obj.
fatal error: Internal error: 'Access violation' at 0x00007ff754b13e99.

Rarely do I ever see a access violation.