emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 7bb5c4f: Port --enable-gcc-warnings to bleeding-e


From: Paul Eggert
Subject: [Emacs-diffs] emacs-25 7bb5c4f: Port --enable-gcc-warnings to bleeding-edge glibc
Date: Mon, 24 Oct 2016 04:55:11 +0000 (UTC)

branch: emacs-25
commit 7bb5c4f206bfbe46b5f4a376633437f8999d956a
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port --enable-gcc-warnings to bleeding-edge glibc
    
    Bleeding-edge glibc sets emacs_cv_var_doug_lea_malloc to 'no'.
    Do not merge to master.
    * configure.ac: Check for valloc decl when compiling gmalloc.c.
    * src/gmalloc.c (emacs_abort) [emacs]: Adjust decl to match
    what is in lisp.h.  Remove duplicate decl.
    (aligned_alloc): #undef before defining.
    (aligned_alloc, memalign) [!MSDOS]: Declare.
    (valloc) [HAVE_DECL_VALLOC]: Remove duplicate decl.
---
 configure.ac  |    5 ++++-
 src/gmalloc.c |   13 ++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7c115a0..ae7dfe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2158,7 +2158,10 @@ elif test "$hybrid_malloc" = yes; then
   GMALLOC_OBJ=gmalloc.o
   VMLIMIT_OBJ=
 else
-  test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
+  if test "$doug_lea_malloc" != "yes"; then
+    GMALLOC_OBJ=gmalloc.o
+    AC_CHECK_DECLS([valloc])
+  fi
   VMLIMIT_OBJ=vm-limit.o
 
   AC_CHECK_HEADERS([sys/vlimit.h])
diff --git a/src/gmalloc.c b/src/gmalloc.c
index d2762d7..fb2861c 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -40,7 +40,7 @@ License along with this library.  If not, see 
<http://www.gnu.org/licenses/>.
 #endif
 
 #ifdef emacs
-extern void emacs_abort (void);
+extern _Noreturn void emacs_abort (void) NO_INLINE;
 #endif
 
 /* If HYBRID_MALLOC is defined, then temacs will use malloc,
@@ -59,6 +59,7 @@ extern void emacs_abort (void);
 #undef malloc
 #undef realloc
 #undef calloc
+#undef aligned_alloc
 #undef free
 #define malloc gmalloc
 #define realloc grealloc
@@ -95,9 +96,9 @@ extern void *calloc (size_t nmemb, size_t size) 
ATTRIBUTE_MALLOC_SIZE ((1,2));
 extern void free (void *ptr);
 
 /* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
-#ifdef MSDOS
 extern void *aligned_alloc (size_t, size_t);
 extern void *memalign (size_t, size_t);
+#ifdef MSDOS
 extern int posix_memalign (void **, size_t, size_t);
 #endif
 
@@ -106,10 +107,6 @@ extern int posix_memalign (void **, size_t, size_t);
 extern void malloc_enable_thread (void);
 #endif
 
-#ifdef emacs
-extern void emacs_abort (void);
-#endif
-
 /* The allocator divides the heap into blocks of fixed size; large
    requests receive one or more whole blocks, and small requests
    receive a fragment of a block.  Fragment sizes are powers of two,
@@ -1686,7 +1683,9 @@ License along with this library.  If not, see 
<http://www.gnu.org/licenses/>.
    or (US mail) as Mike Haertel c/o Free Software Foundation.  */
 
 /* Allocate SIZE bytes on a page boundary.  */
+#ifndef HAVE_DECL_VALLOC
 extern void *valloc (size_t);
+#endif
 
 #if defined _SC_PAGESIZE || !defined HAVE_GETPAGESIZE
 # include "getpagesize.h"
@@ -1769,7 +1768,7 @@ hybrid_aligned_alloc (size_t alignment, size_t size)
 #endif
 }
 #endif
-  
+
 void *
 hybrid_realloc (void *ptr, size_t size)
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]