From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] Expand documentation of common-utils.h::FUNCTION_NAME
Date: Tue, 21 Jan 2014 10:36:00 -0000 [thread overview]
Message-ID: <1390300575-6998-1-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <20140118015244.GA22787@sourceware.org>
Hello,
While looking at this macro, I noticed that it wasn't always necessarily
defined. That prompted me to search the current sources to make sure
that all uses were adequately protected, which they were. But to help
prevent future uses to be made unprotected, this patch expands the
current macro documentation a bit.
gdb/ChangeLog:
* common/common-utils.h (FUNCTION_NAME): Expand the macro's
documentation a bit.
I would commit on its own, but since I am going to put the next in
for the same macro up for review, it's just as easy to make that one
wait as well, in case there are comments.
Thanks,
--
Joel
---
gdb/common/common-utils.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 2d99549..5960c55 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -25,7 +25,12 @@
#include <stddef.h>
#include <stdarg.h>
-/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
+/* If possible, define FUNCTION_NAME, a macro containing the name of
+ the function being defined. Since this macro may not always be
+ defined, all uses must be protected by appropriate macro definition
+ checks (Eg: "#ifdef FUNCTION_NAME").
+
+ Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
which contains the name of the function currently being defined.
This is broken in G++ before version 2.6.
C9x has a similar variable called __func__, but prefer the GCC one since
--
1.8.3.2
next prev parent reply other threads:[~2014-01-21 10:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-18 1:52 New ARI warning Sat Jan 18 01:52:44 UTC 2014 GDB Administrator
2014-01-21 10:36 ` Joel Brobecker [this message]
2014-01-21 10:36 ` [PATCH 2/2] Add ARI (ok) marker for __func__ reference in common-utils.h Joel Brobecker
2014-01-22 4:44 ` Doug Evans
2014-01-22 4:57 ` Joel Brobecker
2014-01-22 5:12 ` pushed: " Joel Brobecker
2014-01-22 4:41 ` [PATCH 1/2] Expand documentation of common-utils.h::FUNCTION_NAME Doug Evans
2014-01-22 4:59 ` Joel Brobecker
2014-01-22 5:20 ` Doug Evans
2014-01-22 5:12 ` pushed: " Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390300575-6998-1-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox