• Debarshi Ray's avatar
    build: Turn off -Wcast-function-type · bb290a1e
    Debarshi Ray authored
    GCC 8 introduced -Wcast-function-type. It is enabled by -Wextra, which
    is on the AX_COMPILER_FLAGS list. Unfortunately, this cannot be sanely
    used with the GNOME platform. It is exceedingly common practice to
    specify a function as a callback that ignores some of the trailing
    parameters passed to it. In fact, the following snippet that's part of
    the g_list_copy_deep documentation triggers -Wcast-function-type:
      another_list = g_list_copy_deep (list,
                                       (GCopyFunc) g_object_ref,
                                       NULL);
    
    Disabling warnings like this does go against the recommendation of the
    AX_COMPILER_FLAGS documentation, which suggests the use of #pragmas
    instead. However, unlike passing the flags through the command line,
    attempts to ignore -Wcast-function-type through a #pragma will trigger
    -Wpragmas on older versions of GCC, and, ironically, using
    G_GNUC_CHECK_VERSION to conditionally disable it on newer compilers
    will trigger -Wexpansion-to-defined, again, because of -Wextra.
    bb290a1e
Name
Last commit
Last update
data Loading commit data...
flatpak Loading commit data...
help Loading commit data...
libgd @ 6085c294 Loading commit data...
m4 Loading commit data...
po Loading commit data...
src Loading commit data...
tests Loading commit data...
.gitmodules Loading commit data...
ARTISTS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
git.mk Loading commit data...
glib-tap.mk Loading commit data...
gnome-photos.doap Loading commit data...