From acadf895728b861105eee84e7a0f8765ba0d957d Mon Sep 17 00:00:00 2001 From: Ivo Raisr Date: Sat, 26 Sep 2015 03:45:11 +0000 Subject: [PATCH] Fix compiler warning about unused functions and variables on older Solaris where original auxv is not present. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15685 --- coregrind/m_initimg/initimg-solaris.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/coregrind/m_initimg/initimg-solaris.c b/coregrind/m_initimg/initimg-solaris.c index 2c20e21767..ee4f155c08 100644 --- a/coregrind/m_initimg/initimg-solaris.c +++ b/coregrind/m_initimg/initimg-solaris.c @@ -275,6 +275,12 @@ static HChar *copy_str(HChar **tab, const HChar *str) return orig; } +#if defined(SOLARIS_RESERVE_SYSSTAT_ADDR) || \ + defined(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR) +#define ORIG_AUXV_PRESENT 1 +#endif + +#if defined(ORIG_AUXV_PRESENT) /* The auxiliary vector might not be present. So we cross-check pointers from argv and envp pointing to the string table. */ static vki_auxv_t *find_original_auxv(Addr init_sp) @@ -328,6 +334,7 @@ static void copy_auxv_entry(const vki_auxv_t *orig_auxv, Int type, VG_(printf)("valgrind: vector. Cannot continue. Sorry.\n\n"); VG_(exit)(1); } +#endif /* ORIG_AUXV_PRESENT */ /* This sets up the client's initial stack, containing the args, environment and aux vector. @@ -391,8 +398,10 @@ static Addr setup_client_stack(Addr init_sp, vg_assert(VG_(args_the_exename)); vg_assert(VG_(args_for_client)); +# if defined(ORIG_AUXV_PRESENT) /* Get the original auxv (if any). */ vki_auxv_t *orig_auxv = find_original_auxv(init_sp); +# endif /* ORIG_AUXV_PRESENT */ /* ==================== compute sizes ==================== */ -- 2.47.2