GNOME Bugzilla – Bug 69097
G_STRLOC causes warning under gcc 3.x
Last modified: 2011-02-18 15:47:08 UTC
The warning is: concatenation of string literals with __FUNCTION__ is deprecated. This feature will be removed in future. Clearly, this is due to the use of __PRETTY_FUNCTION__. But sadly, this means that the very concept of including the function name in a single string literal like the one made by G_STRLOC isn't supported by the gcc team. As a -Werror devotee, this hits me sooner than others, but it will hit everyone when the gcc team actually removes the feature.
(Side note: I'd like to know if there's a way to disable this warning while leaving others on. If someone happens to find out while looking into this, please let me know.)
Yep, familiar with this problem. I'm trying to decide whether it is worth raising a stink with the GCC maintainers about it, or just treat gcc-3.x like non-gcc for G_STRLOC. (Which makes G_STRLOC a lot less useful, but then again, it's already not so useful unless you have gcc.) I've been told that the reason for this incompatible change in gcc was that the old behavior was causing problems because string concatenation is supposed to happen _before_ the compiler decides where the functions are.
OK, basically fixed in HEAD. Moving to the 1.2.11 milestone. Mon Jan 28 17:56:10 2002 Owen Taylor <otaylor@redhat.com> * glib/gmacros.h: Only use __FUNCTION__, __PRETTY_FUNCTION__ for G_GNUC_FUNCTION, G_GNUC_PRETTY_FUNCTION, G_STRLOC when __GNUC__ < 3, since in 3.0.3 the semantics of these functions were changed in an incompatible way. (#69097)
1.2.11 won't happen.
Closing 1.2.11 bugs