ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.41k stars 63 forks source link

build error - "incompatible function pointer types" #313

Open evergreenbear opened 1 year ago

evergreenbear commented 1 year ago

Hi! I am trying to build swaync on OpenMandriva rolling and am running into these errors when running ninja -C build:

ninja: Entering directory `build'
[1/9] Generating .stripped-swaync.1 with a custom command (wrapped by meson to capture output, to feed input)
[2/9] Generating .stripped-swaync.5 with a custom command (wrapped by meson to capture output, to feed input)
[3/9] Generating .stripped-swaync-client.1 with a custom command (wrapped by meson to capture output, to feed input)
[4/9] Generating swaync.5 with a custom command (wrapped by meson to capture output, to feed input)
[5/9] Generating swaync.1 with a custom command (wrapped by meson to capture output, to feed input)
[6/9] Generating swaync-client.1 with a custom command (wrapped by meson to capture output, to feed input)
[7/9] Compiling C object src/swaync.p/meson-generated_controlCenter_widgets_volume_pulseDaemon.c.o
FAILED: src/swaync.p/meson-generated_controlCenter_widgets_volume_pulseDaemon.c.o 
ccache cc -Isrc/swaync.p -Isrc -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/libhandy-1 -I/usr/include/gee-0.8 -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -w -O0 -g -Wno-error=int-conversion -D_REENTRANT -pthread -MD -MQ src/swaync.p/meson-generated_controlCenter_widgets_volume_pulseDaemon.c.o -MF src/swaync.p/meson-generated_controlCenter_widgets_volume_pulseDaemon.c.o.d -o src/swaync.p/meson-generated_controlCenter_widgets_volume_pulseDaemon.c.o -c src/swaync.p/controlCenter/widgets/volume/pulseDaemon.c
../src/controlCenter/widgets/volume/pulseDaemon.vala:76:46: error: incompatible function pointer types passing 'void (pa_context *, pa_server_info *, gpointer)' (aka 'void (struct pa_context *, struct pa_server_info *, void *)') to parameter of type 'pa_server_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_server_info *, void *)') [-Wincompatible-function-pointer-types]
                        _tmp3_ = pa_context_get_server_info (ctx, _sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t, self);
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:458:77: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata);
                                                                            ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:116:57: error: incompatible function pointer types passing 'void (pa_context *, pa_sink_input_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_sink_input_info *, int, void *)') to parameter of type 'pa_sink_input_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_sink_input_info *, int, void *)') [-Wincompatible-function-pointer-types]
                                        _tmp0_ = pa_context_get_sink_input_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t, self);
                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:674:90: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);
                                                                                         ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:136:63: error: incompatible function pointer types passing 'void (pa_context *, pa_sink_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_sink_info *, int, void *)') to parameter of type 'pa_sink_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_sink_info *, int, void *)') [-Wincompatible-function-pointer-types]
                                        _tmp10_ = pa_context_get_sink_info_by_index (ctx, index, _sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t, self);
                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:301:96: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_sink_info_cb_t cb, void *userdata);
                                                                                               ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:154:63: error: incompatible function pointer types passing 'void (pa_context *, pa_card_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_card_info *, int, void *)') to parameter of type 'pa_card_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_card_info *, int, void *)') [-Wincompatible-function-pointer-types]
                                        _tmp27_ = pa_context_get_card_info_by_index (ctx, index, _sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t, self);
                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:622:96: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_card_info_cb_t cb, void *userdata);
                                                                                               ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:172:47: error: incompatible function pointer types passing 'void (pa_context *, pa_server_info *, gpointer)' (aka 'void (struct pa_context *, struct pa_server_info *, void *)') to parameter of type 'pa_server_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_server_info *, void *)') [-Wincompatible-function-pointer-types]
                        _tmp41_ = pa_context_get_server_info (ctx, _sway_notification_center_widgets_pulse_daemon_get_server_info_pa_server_info_cb_t, self);
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:458:77: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata);
                                                                            ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:194:47: error: incompatible function pointer types passing 'void (pa_context *, pa_card_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_card_info *, int, void *)') to parameter of type 'pa_card_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_card_info *, int, void *)') [-Wincompatible-function-pointer-types]
        _tmp5_ = pa_context_get_card_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_card_info_pa_card_info_cb_t, self);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:628:78: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_card_info_list(pa_context *c, pa_card_info_cb_t cb, void *userdata);
                                                                             ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:195:47: error: incompatible function pointer types passing 'void (pa_context *, pa_sink_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_sink_info *, int, void *)') to parameter of type 'pa_sink_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_sink_info *, int, void *)') [-Wincompatible-function-pointer-types]
        _tmp7_ = pa_context_get_sink_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_info_pa_sink_info_cb_t, self);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:304:78: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata);
                                                                             ^
../src/controlCenter/widgets/volume/pulseDaemon.vala:200:54: error: incompatible function pointer types passing 'void (pa_context *, pa_sink_input_info *, gint, gpointer)' (aka 'void (struct pa_context *, struct pa_sink_input_info *, int, void *)') to parameter of type 'pa_sink_input_info_cb_t' (aka 'void (*)(struct pa_context *, const struct pa_sink_input_info *, int, void *)') [-Wincompatible-function-pointer-types]
        _tmp17_ = pa_context_get_sink_input_info_list (ctx, _sway_notification_center_widgets_pulse_daemon_get_sink_input_info_pa_sink_input_info_cb_t, self);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/pulse/introspect.h:674:90: note: passing argument to parameter 'cb' here
pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata);
                                                                                         ^
8 errors generated.
[8/9] Compiling C object src/swaync.p/meson-generated_configModel_configModel.c.o
FAILED: src/swaync.p/meson-generated_configModel_configModel.c.o 
ccache cc -Isrc/swaync.p -Isrc -I../src -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/libhandy-1 -I/usr/include/gee-0.8 -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -w -O0 -g -Wno-error=int-conversion -D_REENTRANT -pthread -MD -MQ src/swaync.p/meson-generated_configModel_configModel.c.o -MF src/swaync.p/meson-generated_configModel_configModel.c.o.d -o src/swaync.p/meson-generated_configModel_configModel.c.o -c src/swaync.p/configModel/configModel.c
../src/configModel/configModel.vala:69:28: error: incompatible function pointer types assigning to 'JsonNode *(*)(JsonSerializable *, const gchar *, const GValue *, GParamSpec *)' (aka 'struct _JsonNode *(*)(struct _JsonSerializable *, const char *, const struct _GValue *, struct _GParamSpec *)') from 'JsonNode *(*)(JsonSerializable *, const gchar *, GValue *, GParamSpec *)' (aka 'struct _JsonNode *(*)(struct _JsonSerializable *, const char *, struct _GValue *, struct _GParamSpec *)') [-Wincompatible-function-pointer-types]
        iface->serialize_property = (JsonNode* (*) (JsonSerializable*, const gchar*, GValue*, GParamSpec*)) sway_notification_center_notification_matching_real_serialize_property;
                                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/configModel/configModel.vala:930:28: error: incompatible function pointer types assigning to 'JsonNode *(*)(JsonSerializable *, const gchar *, const GValue *, GParamSpec *)' (aka 'struct _JsonNode *(*)(struct _JsonSerializable *, const char *, const struct _GValue *, struct _GParamSpec *)') from 'JsonNode *(*)(JsonSerializable *, const gchar *, GValue *, GParamSpec *)' (aka 'struct _JsonNode *(*)(struct _JsonSerializable *, const char *, struct _GValue *, struct _GParamSpec *)') [-Wincompatible-function-pointer-types]
        iface->serialize_property = (JsonNode* (*) (JsonSerializable*, const gchar*, GValue*, GParamSpec*)) sway_notification_center_config_model_real_serialize_property;
                                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: subcommand failed.
ErikReider commented 1 year ago

Not really sure if this is a swaync issue...

ErikReider commented 1 year ago

Are you compiling with gcc?

NovaAndrom3da commented 9 months ago

You can fix this by passing -Wno-incompatible-function-pointer-types to CFLAGS