[glib/glib-2-42] gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-42] gobject: don't use G_STRLOC in G_OBJECT_WARN_INVALID_PSPEC() macro
- Date: Thu, 26 Feb 2015 03:48:28 +0000 (UTC)
commit a770c0c3b635e669039f888c7b9c1012c0b85654
Author: Thomas Haller <thaller redhat com>
Date: Wed Dec 17 10:00:35 2014 +0100
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
gobject/gobject.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gobject/gobject.h b/gobject/gobject.h
index 522011f..096ba7f 100644
--- a/gobject/gobject.h
+++ b/gobject/gobject.h
@@ -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, \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]