build failure on master with clang 16 in goat-exercise-vala.vala
Testing on Windows the CLANG64 profile of MSYS64 with meson and the master branch. This just updated the clang version to 16.0.4. Last time I checked was with clang v. 15 and that had no errors (after applying certain patches that are also needed for v.16).
The specific error suggests that something needs changing in our vala goat exercise:
ninja: build stopped: subcommand failed.
[6/8] Compiling C object extensions/goat-exercises/goat-exercise-vala.exe.p/meson-generated_goat-exercise-vala.c.obj
FAILED: extensions/goat-exercises/goat-exercise-vala.exe.p/meson-generated_goat-exercise-vala.c.obj
"cc" "-Iextensions/goat-exercises/goat-exercise-vala.exe.p" "-Iextensions/goat-exercises" "-I../../gimp/extensions/goat-exercises" "-I." "-I../../gimp" "-Ilibgimp" "-I../..
/gimp/libgimp" "-ID:/msys64/home/Jacob/gimp/libgimp" "-ID:/msys64/clang64/include/gtk-3.0" "-ID:/msys64/clang64/include/pango-1.0" "-ID:/msys64/clang64/include/glib-2.0" "-
ID:/msys64/clang64/lib/glib-2.0/include" "-ID:/msys64/clang64/include/harfbuzz" "-ID:/msys64/clang64/include/freetype2" "-ID:/msys64/clang64/include/libpng16" "-ID:/msys64/
clang64/include/fribidi" "-ID:/msys64/clang64/include/cairo" "-ID:/msys64/clang64/include/pixman-1" "-ID:/msys64/clang64/include/gdk-pixbuf-2.0" "-ID:/msys64/clang64/includ
e/webp" "-ID:/msys64/clang64/include/atk-1.0" "-ID:/msys64/home/Jacob/prefix-gimp-clang64/include/gegl-0.4" "-ID:/msys64/clang64/include/gio-win32-2.0" "-ID:/msys64/clang64
/include/json-glib-1.0" "-ID:/msys64/home/Jacob/prefix-gimp-clang64/include/babl-0.1" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-w" "-O2" "-g" "-Wabsolute-value" "-Wd
eclaration-after-statement" "-Wenum-conversion" "-Wliteral-conversion" "-Wno-strict-prototypes" "-Wold-style-definition" "-Wparentheses-equality" "-W#pragma-messages" "-Wso
metimes-uninitialized" "-Wtautological-unsigned-enum-zero-compare" "-Wunneeded-internal-declaration" "-Wunused-function" "-Wunused-value" "-Werror=implicit-function-declara
tion" "-fdiagnostics-show-option" "-fno-common" "-Wformat" "-Wformat-security" "-Winit-self" "-Wmissing-declarations" "-Wmissing-format-attribute" "-Wpointer-arith" "-Wretu
rn-type" "-Wtype-limits" "-DHAVE_CONFIG_H" "-DLIBDEFLATE_DLL" "-DGETTEXT_PACKAGE=\"org.gimp.extension.goat-exercises\"" -MD -MQ extensions/goat-exercises/goat-exercise-vala
.exe.p/meson-generated_goat-exercise-vala.c.obj -MF "extensions/goat-exercises/goat-exercise-vala.exe.p/meson-generated_goat-exercise-vala.c.obj.d" -o extensions/goat-exerc
ises/goat-exercise-vala.exe.p/meson-generated_goat-exercise-vala.c.obj "-c" extensions/goat-exercises/goat-exercise-vala.exe.p/goat-exercise-vala.c
../../gimp/extensions/goat-exercises/goat-exercise-vala.vala:42:112: error: incompatible function pointer types passing 'GimpValueArray *(GimpProcedure *, GimpRunMode, Gimp
Image *, gint, GimpDrawable **, GimpValueArray *, gpointer)' (aka 'struct _GimpValueArray *(struct _GimpProcedure *, GimpRunMode, struct _GimpImage *, int, struct _GimpDraw
able **, struct _GimpValueArray *, void *)') to parameter of type 'GimpRunImageFunc' (aka 'struct _GimpValueArray *(*)(struct _GimpProcedure *, GimpRunMode, struct _GimpIma
ge *, int, struct _GimpDrawable **, const struct _GimpValueArray *, void *)') [-Wincompatible-function-pointer-types]
_tmp0_ = (GimpImageProcedure*) gimp_image_procedure_new ((GimpPlugIn*) self, name, GIMP_PDB_PROC_TYPE_PLUGIN, _goat_run_gimp_run_image_func, g_object_ref (self), g_
object_unref);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gimp/libgimp/gimpimageprocedure.h:88:66: note: passing argument to parameter 'run_func' here
GimpRunImageFunc run_func,
^
1 error generated.
ninja: build stopped: subcommand failed.
Adding '-Wno-error=incompatible-function-pointer-types'
to warning_cflags_common
in meson.build makes the build succeed, and the vala exercise works as expected.
However, it would be good if someone with vala experience looked at ways to make this error/warning go away.