Subject: | Warnings on Windows 64bit - mingw-w64 compiler |
Hi,
when trying to compile Crypt::Blowfish on 64bit MS Windows (gcc-4.4.3 toolchain by mingw-w64.sf.net) I got the following errors:
gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"2.11\" -DXS_VERSION=\"2.11\" "-IC:\strawberry64\perl\lib\CORE" _blowfish.c
_blowfish.c: In function 'crypt_block':
_blowfish.c:345: warning: cast from pointer to integer of different size
_blowfish.c:345: warning: cast to pointer from integer of different size
...
+ many similar on lines 345, 346, 347, 348, 349, 350, 351, 352
The point is that on 64bit MS Windows there is:
- size of int = 4 bytes (!!!)
- size of *void = 8 bytes
So casting between integer and pointer is not generally safe.
In the end Crypt::Blowfish compiles + pass all tests, however the above mentioned warnings are IMHO worth fixing.
--
kmx
when trying to compile Crypt::Blowfish on 64bit MS Windows (gcc-4.4.3 toolchain by mingw-w64.sf.net) I got the following errors:
gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN64 -DCONSERVATIVE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX -s -O2 -DVERSION=\"2.11\" -DXS_VERSION=\"2.11\" "-IC:\strawberry64\perl\lib\CORE" _blowfish.c
_blowfish.c: In function 'crypt_block':
_blowfish.c:345: warning: cast from pointer to integer of different size
_blowfish.c:345: warning: cast to pointer from integer of different size
...
+ many similar on lines 345, 346, 347, 348, 349, 350, 351, 352
The point is that on 64bit MS Windows there is:
- size of int = 4 bytes (!!!)
- size of *void = 8 bytes
So casting between integer and pointer is not generally safe.
In the end Crypt::Blowfish compiles + pass all tests, however the above mentioned warnings are IMHO worth fixing.
--
kmx