lodepng icon indicating copy to clipboard operation
lodepng copied to clipboard

Compiler warnings when compiling for 64-bit

Open rggjan opened this issue 9 years ago • 3 comments

I get the following warnings when compiling on Windows for 64-bit:

lodepng.cpp(773) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
lodepng.cpp(1437) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
lodepng.cpp(1441) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
lodepng.cpp(1513) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(3458) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(4261) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(4309) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(4389) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5329) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data

Everything seems to work fine, though...

rggjan avatar Nov 18 '15 10:11 rggjan

Yeah. I have the same problem. I just started with lodePNG, but I already love it (finally no libPNG anymore)

Is it actually possible to have some static casts to reduce the size_t warnings as well? I guess it's intended to link lodepng directly into the source and so the warnings from the libs get mixed up with my own ones which can confuse.

Sonicious avatar Dec 15 '15 15:12 Sonicious

This could maybe be solved with https://github.com/lvandeve/lodepng/pull/34

rggjan avatar Jun 06 '16 13:06 rggjan

#34 doesn't solve all 64bit related warnings though. I have solved them all in pull request #51.

jobtalle avatar Mar 18 '17 13:03 jobtalle