This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] malloc: quenche last compiler warnings
- From: Joern Engel <joern at purestorage dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Joern Engel <joern at purestorage dot com>
- Date: Mon, 25 Jan 2016 16:25:25 -0800
- Subject: [PATCH] malloc: quenche last compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <1453767942-19369-1-git-send-email-joern at purestorage dot com>
Looks like __THROW was changed at some point when the __leaf__ attribute
was introduced. And our version of malloc is out of date wrt. modern
compilers and headers.
See /usr/include/x86_64-linux-gnu/sys/cdefs.h
JIRA: PURE-27597
---
tpc/malloc2.13/hooks.h | 2 +-
tpc/malloc2.13/malloc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tpc/malloc2.13/hooks.h b/tpc/malloc2.13/hooks.h
index f855b0f1b165..afc8eeb93a8b 100644
--- a/tpc/malloc2.13/hooks.h
+++ b/tpc/malloc2.13/hooks.h
@@ -343,7 +343,7 @@ realloc_check(Void_t* oldmem, size_t bytes, const Void_t *caller)
static Void_t*
memalign_check(size_t alignment, size_t bytes, const Void_t *caller)
{
- INTERNAL_SIZE_T nb;
+ INTERNAL_SIZE_T nb __attribute__((unused));
Void_t* mem;
if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL);
diff --git a/tpc/malloc2.13/malloc.c b/tpc/malloc2.13/malloc.c
index 9f2d2df47ea1..d9fecfe3f921 100644
--- a/tpc/malloc2.13/malloc.c
+++ b/tpc/malloc2.13/malloc.c
@@ -1324,7 +1324,7 @@ struct malloc_state;
#define __malloc_ptr_t void *
-# define __MALLOC_P(args) args __THROW
+# define __MALLOC_P(args) args __THROWNL
/* This macro will be used for functions which might take C++ callback
functions. */
# define __MALLOC_PMT(args) args
--
2.7.0.rc3