GNOME Bugzilla – Bug 795960
g_format_size_for_display() is deprecated since 2.30
Last modified: 2018-05-09 09:57:21 UTC
Created attachment 371825 [details] [review] g_format_size_for_displayl() is deprecated since 2.30 I met a following warning even if ruby-glib2 (GLib Ruby binding) defines the macro like below[1]: #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_28 rbglib_fileutils.c: In function ‘rbglib_m_format_size_for_display’: rbglib_fileutils.c:56:5: warning: ‘g_format_size_for_display’ is deprecated: Use 'g_format_size' instead [-Wdeprecated-declaration ns] return CSTR2RVAL_FREE(g_format_size_for_display(NUM2OFFT(size))); ^~~~~~ In file included from /usr/include/glib-2.0/glib/gthread.h:34:0, from /usr/include/glib-2.0/glib/gasyncqueue.h:32, from /usr/include/glib-2.0/glib.h:32, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:23, from rbgobject.h:26, from rbgprivate.h:33, from rbglib_fileutils.c:22: /usr/include/glib-2.0/glib/gutils.h:195:8: note: declared here gchar *g_format_size_for_display (goffset size); ^~~~~~~~~~~~~~~~~~~~~~~~~ I think GLib must use GLIB_DEPRECATED_IN_2_30_FOR instead of GLIB_DEPRECATED_FOR like the attached patch. Because g_format_size_for_display() has been deprecated since version 2.30[2]. I can suppress the warning with attached patch. [1]: https://github.com/ruby-gnome2/ruby-gnome2/blob/f8bdfa244eb8b75513a11df22fadab4b2c023796/glib2/ext/glib2/rbgprivate.h#L31 [2]: https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-format-size-for-display
Review of attachment 371825 [details] [review]: Seems reasonable, thanks. I’ll adjust the commit message and push.
Pushed to master, thanks.