summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-12 16:46:23 +1030
committerAlan Modra <amodra@gmail.com>2023-01-12 17:20:21 +1030
commit4981a31d523de41713fc40aa8101b4d73d44df57 (patch)
tree17ff496b3e34113f137fe2b829cdba06a79ed2bc /gold
parent2070fc67bad14bd12c722a7a6baffcafd55e862a (diff)
downloadbinutils-gdb-4981a31d523de41713fc40aa8101b4d73d44df57.tar.gz
Use __func__ rather than __FUNCTION__
We already use C99's __func__ in places, use it more generally. This patch doesn't change uses in the testsuite. I've also left one in gold.h that is protected by GCC_VERSION < 4003. If any of the remaining uses bothers anyone I invite patches. bfd/ * bfd-in.h: Replace __FUNCTION__ with __func__. * elf32-bfin.c: Likewise. * elfnn-aarch64.c: Likewise. * elfxx-sparc.c: Likewise. * bfd-in2.h: Regenerate. gas/ * config/tc-cris.c: Replace __FUNCTION__ with __func__. * config/tc-m68hc11.c: Likewise. * config/tc-msp430.c: Likewise. gold/ * dwp.h: Replace __FUNCTION__ with __func__. * gold.h: Likewise, except for use inside GCC_VERSION < 4003. ld/ * emultempl/pe.em: Replace __FUNCTION__ with __func__. * emultempl/pep.em: Likewise. * pe-dll.c: Likewise.
Diffstat (limited to 'gold')
-rw-r--r--gold/dwp.h2
-rw-r--r--gold/gold.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/gold/dwp.h b/gold/dwp.h
index 28d687bc891..d921a825a0c 100644
--- a/gold/dwp.h
+++ b/gold/dwp.h
@@ -94,7 +94,7 @@ gold_info(const char* msg, ...) ATTRIBUTE_PRINTF_1;
#define gold_unreachable() \
(gold::do_gold_unreachable(__FILE__, __LINE__, \
- static_cast<const char*>(__FUNCTION__)))
+ static_cast<const char*>(__func__)))
extern void do_gold_unreachable(const char*, int, const char*)
ATTRIBUTE_NORETURN;
diff --git a/gold/gold.h b/gold/gold.h
index 40c3ee180fc..636d93935c1 100644
--- a/gold/gold.h
+++ b/gold/gold.h
@@ -163,7 +163,7 @@ gold_nomem() ATTRIBUTE_NORETURN;
#if defined(__GNUC__) && GCC_VERSION < 4003
#define FUNCTION_NAME static_cast<const char*>(__FUNCTION__)
#else
-#define FUNCTION_NAME __FUNCTION__
+#define FUNCTION_NAME __func__
#endif
// This macro and function are used in cases which can not arise if