Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converts to incompatible function type [-Werror,-Wcast-function-type-strict] #4564

Closed
bambier opened this issue Jan 27, 2024 · 2 comments
Closed

Comments

@bambier
Copy link

bambier commented Jan 27, 2024

I tried to create android application with p4a but after running create app I got this error which points to problem in harfbuzz .

How can I fix this?

PS: I had created same issue in p4a repo

rm -f /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-font.o
/usr/bin/ccache /home/{username}/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -MMD -MP -MF /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-font.o.d -target armv7-none-linux-androideabi27 -fdata-sections -ffunction-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes  --sysroot /home/{username}/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -Wno-invalid-command-line-argument -Wno-unused-command-line-argument  -D_FORTIFY_SOURCE=2 -fno-exceptions -fno-rtti -fpic -O0 -UNDEBUG -fno-limit-debug-info  -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/../freetype/include/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz    -DANDROID -DHAVE_CONFIG_H -fPIC -Wformat -Werror=format-security   -c  /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-font.cc -o /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-font.o
[armeabi-v7a] Compile++ arm  : harfbuzz <= hb-ft.cc
rm -f /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-ft.o
/usr/bin/ccache /home/{username}/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -MMD -MP -MF /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-ft.o.d -target armv7-none-linux-androideabi27 -fdata-sections -ffunction-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes  --sysroot /home/{username}/Android/Sdk/ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -Wno-invalid-command-line-argument -Wno-unused-command-line-argument  -D_FORTIFY_SOURCE=2 -fno-exceptions -fno-rtti -fpic -O0 -UNDEBUG -fno-limit-debug-info  -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/../freetype/include/ -I/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz    -DANDROID -DHAVE_CONFIG_H -fPIC -Wformat -Werror=format-security   -c  /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc -o /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-ft.o
/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:759:73: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  if (unlikely (!ft_face->generic.data || ft_face->generic.finalizer != (FT_Generic_Finalizer) hb_ft_face_finalize))
                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb.hh:263:25: note: expanded from macro 'unlikely'
#define unlikely(expr) (expr)
                        ^~~~
/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:765:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/jni/SDL2_ttf/external/harfbuzz/src/hb-ft.cc:1035:32: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make: *** [/home/{username}/Android/Sdk/ndk/android-ndk-r26b/build/core/build-binary.mk:415: /home/{username}/.local/share/python-for-android/build/bootstrap_builds/sdl2/obj/local/armeabi-v7a/objs-debug/harfbuzz/src/hb-ft.o] Error 1

@behdad
Copy link
Member

behdad commented Jan 28, 2024

What version of HarfBuzz are you using. I believe we have fixed these long time ago.

@bambier
Copy link
Author

bambier commented Jan 28, 2024

Thanks for response;
Well I don't have access to version controlling of used HarfBazz due to that it downloaded automatically by p4a.
I thought that p4a uses the last version of HarfBazz. After Cheking the version of HarfBazz in source code I noticed that version 2.6.4 is used by p4a which seems to be outdated due to latest version of HarfBazz is 8.3.0 according to this git-hub repo.

So I close this issue and looking forward in to p4a repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants