rhash / RHash

Great utility for computing hash sums
http://rhash.sf.net
BSD Zero Clause License
585 stars 116 forks source link

Incompatible pointer to integer conversion in rhash.c #254

Closed dg0yt closed 9 months ago

dg0yt commented 11 months ago

While testing the vcpkg port with Android NDK r26:

FAILED: CMakeFiles/rhash.dir/rhash.c.o 
/vcpkg/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=armv7-none-linux-androideabi21 --sysroot=/vcpkg/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DIN_RHASH -DRHASH_XVERSION=\"\"  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -fPIC   -fno-limit-debug-info    -fPIC -MD -MT CMakeFiles/rhash.dir/rhash.c.o -MF CMakeFiles/rhash.dir/rhash.c.o.d -o CMakeFiles/rhash.dir/rhash.c.o -c /mnt/vcpkg-ci/b/rhash/src/v1.4.4-e609ae2b07.clean/librhash/rhash.c
/mnt/vcpkg-ci/b/rhash/src/v1.4.4-e609ae2b07.clean/librhash/rhash.c:877:10: error: incompatible pointer to integer conversion returning 'char[1]' from a function with result type 'rhash_uptr_t' (aka 'unsigned int') [-Wint-conversion]
                return RHASH_XVERSION;
                       ^~~~~~~~~~~~~~
<command line>:2:24: note: expanded from macro 'RHASH_XVERSION'
#define RHASH_XVERSION ""
                       ^~
1 error generated.

(Ignore the empty RHASH_XVERSION.)

The build succeeds when wrapping RHASH_XVERSION in PVOID2UPTR(...). However, this ignores alignment.

georgeraraujo commented 10 months ago

Could you add the preprocessor definition

RHASH_XVERSION=0x01040400

and try again? configure defines it, but maybe CMake does not.

rhash commented 9 months ago

Read the previous answer. Also, cmake is not currently supported yet.

dg0yt commented 9 months ago

Thank you, I realize that this is poor porting in vcpkg. Sorry for the noise.