Skip to content

Build failure with upcoming Clang 16 (-Wincompatible-function-pointer-types) #12

@thesamesam

Description

@thesamesam

Clang 16 will make -Wincompatible-function-pointer-types an error by default.

You can emulate this error using:

  • GCC via -Werror=incompatible-pointer-types (GCC lacks a more specific warning for just func. ptrs)
  • Clang <16 via -Werror=incompatible-function-pointer-types

Originally reported downstream in Gentoo at https://bugs.gentoo.org/880997.

echomixer.c:2108:7: error: incompatible function pointer types passing 'void
      (GtkWidget *, gpointer)' (aka 'void (struct _GtkWidget *, void *)') to
      parameter of type 'GCallback' (aka 'void (*)(void)')
      [-Werror,-Wincompatible-function-pointer-types]
  ...gtk_signal_connect(GTK_OBJECT(menuitem), "activate", Digital_mode_activate, (gpointer)(long)i);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-2.0/gtk/gtksignal.h:51:47: note: expanded from macro
      'gtk_signal_connect'
   gtk_signal_connect_full ((object), (name), (func), NULL, (func_data)...
                                              ^~~~~~
/usr/include/gtk-2.0/gtk/gtksignal.h:123:23: note: passing argument to parameter
      'func' here
                                                 GCallback           func,
                                                                     ^
[...]

Full build log: https://bugs.gentoo.org/attachment.cgi?id=831477

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions