GNOME Bugzilla – Bug 744263
Fix format specifier for __LINE__ in G_OBJECT_WARN_INVALID_PSPEC
Last modified: 2015-02-26 12:23:09 UTC
GCC 5.0, with its new -Wformat-signedness, warns about the sign being different between a type and the format string in printf-format messages, leading to compiler warnings with G_OBJECT_WARN_INVALID_PSPEC. In other uses of __LINE__ inside GLib, %d is used, and GCC seems to expect a format specifier of %d as well: https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html The warning can be triggered when compiling code which uses G_OBJECT_WARN_INVALID_PSPEC (or G_OBJECT_WARN_INVALID_PROPERTY_ID, which I tested in Yelp) with -Wformat=2.
Created attachment 296495 [details] [review] proposed patch
Review of attachment 296495 [details] [review]: sure
commit d36f6a9633f18cbf14e8a52add66b40d8eb6a4da Author: David King <dking@redhat.com> Date: Mon Feb 9 11:23:58 2015 +0000 gobject.h: Use correct format specifier for __LINE__ GCC 5.0, with its new -Wformat-signedness, warns about the sign being different between a type and the format string in printf-format messages, leading to compiler warnings with G_OBJECT_WARN_INVALID_PSPEC. In other uses of __LINE__ inside GLib, %d is used, and GCC seems to expect a format specifier of %d as well: https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html https://bugzilla.gnome.org/show_bug.cgi?id=744263
Review of attachment 296495 [details] [review]: On master as d36f6a9633f18cbf14e8a52add66b40d8eb6a4da.