GNOME Bugzilla – Bug 749195
deprecated object warning defaults to enabled
Last modified: 2017-11-17 12:36:14 UTC
The docs for G_PARAM_DEPRECATED says: * @G_PARAM_DEPRECATED: the parameter is deprecated and will be removed * in a future version. A warning will be generated if it is used * while running with G_ENABLE_DIAGNOSTIC=1. so the warning should be output only when that env var is set. That makes sense, since this warning is only ever useful to developers, and otherwise needlessly pollutes the journal or ~/.xsession-errors. However, the code defaults to 'enable' if the env var is NOT set: [gobject/gobject.c:] static void consider_issuing_property_deprecation_warning (const GParamSpec *pspec) { static GHashTable *already_warned_table; static const gchar *enable_diagnostic; static GMutex already_warned_lock; gboolean already; if (!(pspec->flags & G_PARAM_DEPRECATED)) return; if (g_once_init_enter (&enable_diagnostic)) { const gchar *value = g_getenv ("G_ENABLE_DIAGNOSTIC"); if (!value) ===> value = "-"; g_once_init_leave (&enable_diagnostic, value); } if (enable_diagnostic[0] == '0') return; The fix is easy: change |value = "-";| with |value = "0";| above.
Let’s keep all the discussion about deprecation warnings in one place: bug #732184. (Also, they were turned off by default for properties in commit 3bd1618ea955f950f87bc4e452029c5f0cea35aa, and have remained that way since.) *** This bug has been marked as a duplicate of bug 733298 ***