summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-10-22 01:11:30 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-10-22 01:11:30 +0300
commit7e1c24c624fa7a01be01b2d86e384474f8ca4224 (patch)
tree02956b1ba7887351c4722346a8964f5e5fe79846
parent5d59443fb17a474909e89f25238b02f4734ac5e7 (diff)
downloadbdwgc-7e1c24c624fa7a01be01b2d86e384474f8ca4224.tar.gz
Eliminate 'value of GC_RETURN_ADDR_PARENT unknown' cppcheck info messages
* dbg_mlc.c [GC_ADD_CALLER]: Replace defined(GC_RETURN_ADDR_PARENT) with defined(GC_HAVE_RETURN_ADDR_PARENT). * include/private/gc_priv.h (GC_DBG_EXTRAS): Likewise. * include/gc_config_macros.h [GC_RETURN_ADDR_PARENT] (GC_HAVE_RETURN_ADDR_PARENT): New macro.
-rw-r--r--dbg_mlc.c2
-rw-r--r--include/gc_config_macros.h1
-rw-r--r--include/private/gc_priv.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/dbg_mlc.c b/dbg_mlc.c
index 5d053d4f..fbfa6bc4 100644
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -486,7 +486,7 @@ GC_API void GC_CALL GC_debug_register_displacement(size_t offset)
}
#ifdef GC_ADD_CALLER
-# if defined(HAVE_DLADDR) && defined(GC_RETURN_ADDR_PARENT)
+# if defined(HAVE_DLADDR) && defined(GC_HAVE_RETURN_ADDR_PARENT)
# include <dlfcn.h>
STATIC void GC_caller_func_offset(word ad, const char **symp, int *offp)
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index 0009b7be..9f7f7d74 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -330,6 +330,7 @@
# define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
# if (__GNUC__ >= 4) && (defined(__i386__) || defined(__amd64__) \
|| defined(__x86_64__) /* and probably others... */)
+# define GC_HAVE_RETURN_ADDR_PARENT
# define GC_RETURN_ADDR_PARENT \
(GC_word)__builtin_extract_return_addr(__builtin_return_address(1))
# endif
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index a23a3e8d..4468984b 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -1892,7 +1892,7 @@ GC_INNER ptr_t GC_allocobj(size_t sz, int kind);
/* GC_DBG_EXTRAS is used by GC debug API functions (unlike GC_EXTRAS */
/* used by GC debug API macros) thus GC_RETURN_ADDR_PARENT (pointing */
/* to client caller) should be used if possible. */
-# ifdef GC_RETURN_ADDR_PARENT
+# ifdef GC_HAVE_RETURN_ADDR_PARENT
# define GC_DBG_EXTRAS GC_RETURN_ADDR_PARENT, NULL, 0
# else
# define GC_DBG_EXTRAS GC_RETURN_ADDR, NULL, 0