clang++-16 is even pickier than clang++-15. Here's the diff I came up with. I renamed the function arguments to match upstream harfbuzz, but I didn't want to pull the whole diff because the rest looks cosmetic.
ok? Index: Makefile =================================================================== RCS file: /home/cvs/ports/devel/sdl2-ttf/Makefile,v diff -u -p -r1.15 Makefile --- Makefile 21 Sep 2023 09:50:05 -0000 1.15 +++ Makefile 10 Nov 2023 15:39:04 -0000 @@ -2,7 +2,7 @@ V = 2.20.2 COMMENT = SDL2 TrueType fonts library DISTNAME = SDL2_ttf-${V} PKGNAME = sdl2-ttf-${V} -REVISION = 1 +REVISION = 2 CATEGORIES = devel graphics fonts SHARED_LIBS += SDL2_ttf 0.1 # 10.2 Index: patches/patch-external_harfbuzz_src_hb-ft_cc =================================================================== RCS file: patches/patch-external_harfbuzz_src_hb-ft_cc diff -N patches/patch-external_harfbuzz_src_hb-ft_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-external_harfbuzz_src_hb-ft_cc 10 Nov 2023 15:38:59 -0000 @@ -0,0 +1,30 @@ +Fix build error with clang-16: +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] + +Subset of https://github.com/harfbuzz/harfbuzz/commit/d88269c827895b38f99f7cf741fa60210d4d5169 + +Index: external/harfbuzz/src/hb-ft.cc +--- external/harfbuzz/src/hb-ft.cc.orig ++++ external/harfbuzz/src/hb-ft.cc +@@ -729,8 +729,9 @@ hb_ft_face_create_referenced (FT_Face ft_face) + } + + static void +-hb_ft_face_finalize (FT_Face ft_face) ++hb_ft_face_finalize (void *arg) + { ++ FT_Face ft_face = (FT_Face) arg; + hb_face_destroy ((hb_face_t *) ft_face->generic.data); + } + +@@ -949,8 +950,9 @@ get_ft_library () + } + + static void +-_release_blob (FT_Face ft_face) ++_release_blob (void *arg) + { ++ FT_Face ft_face = (FT_Face) arg; + hb_blob_destroy ((hb_blob_t *) ft_face->generic.data); + } + -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE