Maybe a bit OT as not at all game related but still C/programming/library related.
I've been compiling a lot of originally linux/unix libraries and programs on Win64 lately and it works without too many problems except for one recurrent warning happening a massive amount of time, eg:
hash_sha.c
c:\php-sdk\phpdev\vc12\x64\php56\zend\zend_execute.h(247) : warning C4267: 'func
tion' : conversion from 'size_t' to 'int', possible loss of data
No matter what I compile, openssl, libcurl, engine-pkcs11, opensc-pkcs11, apr, apr-util, apr-iconv, apache 2.4.18 and modules, php5.6.17 etc this warning keeps sprouting up. I know it's not without consequences (integer overflow exploit potential!) although I'm not compiling for a production environment, only for my own learning.
I still wonder if there is a one-size-fits-all approach to tackle this, maybe defining size_t as something else or should I in theory replace all occurrences on a 1 by 1 basis to determine whether a 64-bit or 32-bit is appropriate there? That would be a massive amount of work and I kinda wonder how win64 seems to only be an afterthought even now in 2016.
AFAIK size_t is 8 bytes on win64, 4 bytes on x64-linux, is that correct? So the one-size-fits-all could be to redefine size_t as a 4 byte type but I feel queasy doing this. There could always be places where a size_t is cast to a pointer type even though it's bad practice.
I guess if all occurrences have to be touched it's the ints that need to become size_t's?
Still I wonder if existing x64 window binaries of say Apache and PHP were compiled with these warning left ignored and that's why they say those ports are "experimental" or did they correct it somehow?