{"action":"created","issue":{"url":"https://api.github.com/repos/clear-code/statistics/issues/165","repository_url":"https://api.github.com/repos/clear-code/statistics","labels_url":"https://api.github.com/repos/clear-code/statistics/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/clear-code/statistics/issues/165/comments","events_url":"https://api.github.com/repos/clear-code/statistics/issues/165/events","html_url":"https://github.com/clear-code/statistics/issues/165","id":320498930,"number":165,"title":"GLib: g_format_size_for_displayのdeprecated情報にバージョン情報がない","user":{"login":"kou","id":27350,"avatar_url":"https://avatars3.githubusercontent.com/u/27350?v=4","gravatar_id":"","url":"https://api.github.com/users/kou","html_url":"https://github.com/kou","followers_url":"https://api.github.com/users/kou/followers","following_url":"https://api.github.com/users/kou/following{/other_user}","gists_url":"https://api.github.com/users/kou/gists{/gist_id}","starred_url":"https://api.github.com/users/kou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kou/subscriptions","organizations_url":"https://api.github.com/users/kou/orgs","repos_url":"https://api.github.com/users/kou/repos","events_url":"https://api.github.com/users/kou/events{/privacy}","received_events_url":"https://api.github.com/users/kou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-05T10:38:06Z","updated_at":"2018-05-08T04:28:17Z","closed_at":null,"author_association":"OWNER","body":"https://gitlab.gnome.org/GNOME/glib\r\n\r\n```c\r\n#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_28\r\n```\r\n\r\nを設定しても、[`g_file_format`](https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-format-size-for-display)を使うと次のようなwarningがでる。\r\n\r\n```text\r\nrbglib_fileutils.c: In function ‘rbglib_m_format_size_for_display’:\r\nrbglib_fileutils.c:56:5: warning: ‘g_format_size_for_display’ is deprecated: Use 'g_format_size' instead [-Wdeprecated-declarations]\r\n     return CSTR2RVAL_FREE(g_format_size_for_display(NUM2OFFT(size)));\r\n     ^~~~~~\r\nIn file included from /usr/include/glib-2.0/glib/gthread.h:34:0,\r\n                 from /usr/include/glib-2.0/glib/gasyncqueue.h:32,\r\n                 from /usr/include/glib-2.0/glib.h:32,\r\n                 from /usr/include/glib-2.0/gobject/gbinding.h:28,\r\n                 from /usr/include/glib-2.0/glib-object.h:23,\r\n                 from rbgobject.h:26,\r\n                 from rbgprivate.h:33,\r\n                 from rbglib_fileutils.c:22:\r\n/usr/include/glib-2.0/glib/gutils.h:195:8: note: declared here\r\n gchar *g_format_size_for_display (goffset size);\r\n        ^~~~~~~~~~~~~~~~~~~~~~~~~\r\n```\r\n\r\n[`GLIB_DEPRECATED_FOR`](https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#G-DEPRECATED-FOR:CAPS)じゃなくてバージョン指定付きのやつを使わないと`GLIB_VERSION_MIN_REQUIRED`を指定してもdeprecated warningがでてしまう。\r\n\r\n```diff\r\ndiff --git a/glib/gutils.h b/glib/gutils.h\r\nindex 52b6297dc..333e2c5a4 100644\r\n--- a/glib/gutils.h\r\n+++ b/glib/gutils.h\r\n@@ -191,7 +191,7 @@ gchar *g_format_size_full   (guint64          size,\r\n GLIB_AVAILABLE_IN_2_30\r\n gchar *g_format_size        (guint64          size);\r\n \r\n-GLIB_DEPRECATED_FOR(g_format_size)\r\n+GLIB_DEPRECATED_IN_2_30_FOR(g_format_size)\r\n gchar *g_format_size_for_display (goffset size);\r\n \r\n #ifndef G_DISABLE_DEPRECATED\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/clear-code/statistics/issues/comments/387280787","html_url":"https://github.com/clear-code/statistics/issues/165#issuecomment-387280787","issue_url":"https://api.github.com/repos/clear-code/statistics/issues/165","id":387280787,"user":{"login":"okkez","id":33111,"avatar_url":"https://avatars1.githubusercontent.com/u/33111?v=4","gravatar_id":"","url":"https://api.github.com/users/okkez","html_url":"https://github.com/okkez","followers_url":"https://api.github.com/users/okkez/followers","following_url":"https://api.github.com/users/okkez/following{/other_user}","gists_url":"https://api.github.com/users/okkez/gists{/gist_id}","starred_url":"https://api.github.com/users/okkez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okkez/subscriptions","organizations_url":"https://api.github.com/users/okkez/orgs","repos_url":"https://api.github.com/users/okkez/repos","events_url":"https://api.github.com/users/okkez/events{/privacy}","received_events_url":"https://api.github.com/users/okkez/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T04:28:17Z","updated_at":"2018-05-08T04:28:17Z","author_association":"OWNER","body":"うーむ。勘違いしてた。パッチは最初のコメントのでよさそう。\r\n\r\n```\r\n$ cd ruby-gnome2\r\n$ bundle install\r\n$ cd glib2\r\n$ bundle exec ruby extconf.rb\r\n$ make -j\r\n```\r\n↑だとシステムにインストールしてある GLib を使ってしまう。\r\nパッチをあてて /tmp/local 以下にインストールした GLib を使うには以下のようにした。\r\n\r\n```\r\n$ bundle exec env CFLAGS=\"$(PKG_CONFIG_PATH=/tmp/local/lib/pkgconfig pkg-config --cflags glib-2.0)\" ruby extconf.rb\r\n$ make -j\r\n```\r\n\r\nこれでパッチをあてると ruby-gnome2/glib2 で警告が消えることを確認できた。\r\n"}}
{"actor":{"display_login":"okkez"}}