After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 673913 - gmacros: Try to use the standard __func__ first in G_STRFUNC
gmacros: Try to use the standard __func__ first in G_STRFUNC
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
2.35.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-04-11 14:49 UTC by Javier Jardón (IRC: jjardon)
Modified: 2018-05-24 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gmacros: Try to use the standard __func__ first in G_STRFUNC (1.94 KB, patch)
2012-04-11 14:50 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
gmacros: Try to use the standard __func__ first in G_STRFUNC.v2 (1.94 KB, patch)
2012-04-11 15:08 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
gmacros: Try to use the standard __func__ first in G_STRFUNC.v3 (1.53 KB, patch)
2014-01-13 12:48 UTC, Javier Jardón (IRC: jjardon)
reviewed Details | Review

Description Javier Jardón (IRC: jjardon) 2012-04-11 14:49:46 UTC
__func__ is part of the C99 standard.
__FUNCTION__ is another name for __func__. Older versions of GCC recognize only this name. However, it is not standardized. For maximum portability, Its recommended to use __func__.

See http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
Comment 1 Javier Jardón (IRC: jjardon) 2012-04-11 14:50:48 UTC
Created attachment 211838 [details] [review]
gmacros: Try to use the standard __func__ first in G_STRFUNC
Comment 2 Javier Jardón (IRC: jjardon) 2012-04-11 15:08:25 UTC
Created attachment 211841 [details] [review]
gmacros: Try to use the standard __func__ first in G_STRFUNC.v2
Comment 3 Dan Winship 2013-02-15 15:17:26 UTC
Comment on attachment 211841 [details] [review]
gmacros: Try to use the standard __func__ first in G_STRFUNC.v2

>+#  define __func__ __func__

that seems a little goofy

Why not

#ifdef __func__
#  define G_STRFUNC     ((const char*) (__func__))

?
Comment 4 Javier Jardón (IRC: jjardon) 2014-01-13 12:48:49 UTC
Created attachment 266153 [details] [review]
gmacros: Try to use the standard __func__ first in G_STRFUNC.v3
Comment 5 Dan Winship 2014-02-15 18:56:36 UTC
Comment on attachment 266153 [details] [review]
gmacros: Try to use the standard __func__ first in G_STRFUNC.v3

OK to commit as long as you have run "make check" and verified that this doesn't break any tests (eg because of g_test_expect_message())

>Subject: [PATCH] cros: Try to use the standard __func__ first in G_STRFUNC

not sure what stage it happened in, but the subject is slightly mangled there ("cros" instead of "gmacros"). Make sure it doesn't get committed that way.
Comment 6 GNOME Infrastructure Team 2018-05-24 13:59:40 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/535.