From: Rhys Kidd Date: Mon, 19 Oct 2015 10:20:17 +0000 (+0000) Subject: Silence -Wincompatible-pointer-types-discards-qualifiers warning. n-i-bz. X-Git-Tag: svn/VALGRIND_3_12_0~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb7055b7edbd1bcac95999c0fecf9eecc4e537da;p=thirdparty%2Fvalgrind.git Silence -Wincompatible-pointer-types-discards-qualifiers warning. n-i-bz. m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME' return vg_default_zone.zone_name; \ ^~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] ZONE_GET_NAME(SO_SYN_MALLOC, malloc_get_zone_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME' return vg_default_zone.zone_name; \ ^~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1286:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] ZONE_GET_NAME(VG_Z_LIBC_SONAME, malloc_get_zone_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME' return vg_default_zone.zone_name; \ ^~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1287:1: warning: returning 'const char *' from a function with result type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] ZONE_GET_NAME(SO_SYN_MALLOC, malloc_get_zone_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_replacemalloc/vg_replace_malloc.c:1283:14: note: expanded from macro 'ZONE_GET_NAME' return vg_default_zone.zone_name; \ ^~~~~~~~~~~~~~~~~~~~~~~~~ No regressions on OS X 10.10 Before: == 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == After: == 596 tests, 219 stderr failures, 10 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15712 --- diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index dc39d6a004..ccac130642 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1276,8 +1276,8 @@ ZONE_SET_NAME(SO_SYN_MALLOC, malloc_set_zone_name); #define ZONE_GET_NAME(soname, fnname) \ \ - char* VG_REPLACE_FUNCTION_EZU(10280,soname,fnname)(void* zone); \ - char* VG_REPLACE_FUNCTION_EZU(10280,soname,fnname)(void* zone) \ + const char* VG_REPLACE_FUNCTION_EZU(10280,soname,fnname)(void* zone); \ + const char* VG_REPLACE_FUNCTION_EZU(10280,soname,fnname)(void* zone) \ { \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(zone); \ return vg_default_zone.zone_name; \