gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro

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__.

https://bugzilla.gnome.org/show_bug.cgi?id=741654
This commit is contained in:
Thomas Haller 2014-12-17 10:00:35 +01:00
parent d951db4236
commit c447bc7f93

View File

@ -627,8 +627,8 @@ G_STMT_START { \
GObject *_glib__object = (GObject*) (object); \
GParamSpec *_glib__pspec = (GParamSpec*) (pspec); \
guint _glib__property_id = (property_id); \
g_warning ("%s: invalid %s id %u for \"%s\" of type '%s' in '%s'", \
G_STRLOC, \
g_warning ("%s:%u: invalid %s id %u for \"%s\" of type '%s' in '%s'", \
__FILE__, __LINE__, \
(pname), \
_glib__property_id, \
_glib__pspec->name, \