GNOME Bugzilla – Bug 741654
[patch] gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro
Last modified: 2014-12-18 14:05:19 UTC
Using G_STRLOC ends up embedding unique strings of the form __FILE__:__LINE__ in the compiled binary. We can avoid these by passing __FILE__ and __LINE__ separately when constructing the warning text. This probably reduces the size of the binary as __FILE__ is likely already contained as string otherwise. Note that for GCC 2.x this changes behavior because G_STRLOC also contained __PRETTY_FUNCTION__. For example in NetworkManager project, there are more than 300 uses of G_OBJECT_WARN_INVALID_PROPERTY_ID(). This patch would save quite some static strings.
Created attachment 292905 [details] [review] [patch] gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro
Review of attachment 292905 [details] [review]: Looks nice, and well-justified. Fine by me. fwiw, we don't do Signed-off-by: lines in GLib.
Thanks. Applied as https://git.gnome.org/browse/glib/commit/?id=c447bc7f93fbc6e1aaf7f46eef9da2f820c8f209