After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795960 - g_format_size_for_display() is deprecated since 2.30
g_format_size_for_display() is deprecated since 2.30
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-05-09 01:24 UTC by okimoto
Modified: 2018-05-09 09:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_format_size_for_displayl() is deprecated since 2.30 (431 bytes, patch)
2018-05-09 01:24 UTC, okimoto
committed Details | Review

Description okimoto 2018-05-09 01:24:32 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
Comment 1 Philip Withnall 2018-05-09 09:54:43 UTC
Review of attachment 371825 [details] [review]:

Seems reasonable, thanks. I’ll adjust the commit message and push.
Comment 2 Philip Withnall 2018-05-09 09:57:15 UTC
Pushed to master, thanks.