Skip to content

Warn about GLib functions newer than the checked GLib version

Ghost User requested to merge (removed):warn_2_56 into master

Warn about GLib functions newer than the checked GLib version

This patch enables GLib deprecation warnings in all XFCE apps and libraries containing function calls such as XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.56.0]) in their configure.ac.in files in the following way:

AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_56, Prevent post 2_56 APIs)
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_56, Ignore post 2_56 APIs)

The 3rd argument passed to XDT_CHECK_PACKAGE([GLIB], ...) selects the GLib API version. So XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.44.0]) would add:

AC_DEFINE(GLIB_VERSION_MAX_ALLOWED, GLIB_VERSION_2_44, Prevent post 2_44 APIs)
AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_44, Ignore post 2_44 APIs)

The enabled warnings can be overridden by the app or library by using the two AC_DEFINEs after calling XDT_CHECK_PACKAGE([GLIB], ...).

Something like XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.45.8]) will make the XFCE app or library uncompilable because 2.45 isn't a stable GLib release.

See also: apps/xfce4-notifyd#34 (closed)

Edited by Ghost User

Merge request reports

Loading