diff options
| author | Paul Eggert | 2016-01-30 14:20:57 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-01-30 15:26:08 -0800 |
| commit | 3d82a8ee4bd392ae536c8c3640140d1d0f594f44 (patch) | |
| tree | bce897370545df1d8b65c6474f7cafe5b68cd3f5 /src | |
| parent | 7fdc3cf046ee112b883752ea15ca8cb05444d12f (diff) | |
| download | emacs-3d82a8ee4bd392ae536c8c3640140d1d0f594f44.tar.gz emacs-3d82a8ee4bd392ae536c8c3640140d1d0f594f44.zip | |
Fix extern symbols defined and not used
* src/alloc.c: Always include <signal.h>.
(malloc_warning) [!SIGDANGER && (SYSTEM_MALLOC || HYBRID_MALLOC)]:
Do not define; unused.
* src/emacs.c, src/lisp.h (might_dump) [!DOUG_LEA_MALLOC]: Now static.
* src/gmalloc.c (gdefault_morecore): Rename from __default_morecore,
to avoid collision with glibc. Now static. All uses changed.
* src/lastfile.c (my_edata): Define only if
((!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined
WINDOWSNT) \ || defined CYGWIN || defined DARWIN_OS).
(Bug#22086)
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 8 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/gmalloc.c | 7 | ||||
| -rw-r--r-- | src/lastfile.c | 3 | ||||
| -rw-r--r-- | src/lisp.h | 2 |
5 files changed, 15 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c index b1d3f2e6511..57ef4c5deab 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -22,10 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 22 | 22 | ||
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | #include <limits.h> /* For CHAR_BIT. */ | 24 | #include <limits.h> /* For CHAR_BIT. */ |
| 25 | 25 | #include <signal.h> /* For SIGABRT, SIGDANGER. */ | |
| 26 | #ifdef ENABLE_CHECKING | ||
| 27 | #include <signal.h> /* For SIGABRT. */ | ||
| 28 | #endif | ||
| 29 | 26 | ||
| 30 | #ifdef HAVE_PTHREAD | 27 | #ifdef HAVE_PTHREAD |
| 31 | #include <pthread.h> | 28 | #include <pthread.h> |
| @@ -565,6 +562,8 @@ static struct Lisp_Finalizer doomed_finalizers; | |||
| 565 | Malloc | 562 | Malloc |
| 566 | ************************************************************************/ | 563 | ************************************************************************/ |
| 567 | 564 | ||
| 565 | #if defined SIGDANGER || (!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC) | ||
| 566 | |||
| 568 | /* Function malloc calls this if it finds we are near exhausting storage. */ | 567 | /* Function malloc calls this if it finds we are near exhausting storage. */ |
| 569 | 568 | ||
| 570 | void | 569 | void |
| @@ -573,6 +572,7 @@ malloc_warning (const char *str) | |||
| 573 | pending_malloc_warning = str; | 572 | pending_malloc_warning = str; |
| 574 | } | 573 | } |
| 575 | 574 | ||
| 575 | #endif | ||
| 576 | 576 | ||
| 577 | /* Display an already-pending malloc warning. */ | 577 | /* Display an already-pending malloc warning. */ |
| 578 | 578 | ||
diff --git a/src/emacs.c b/src/emacs.c index de770a6d7f5..540bf736fec 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -128,6 +128,9 @@ Lisp_Object Vlibrary_cache; | |||
| 128 | bool initialized; | 128 | bool initialized; |
| 129 | 129 | ||
| 130 | /* Set to true if this instance of Emacs might dump. */ | 130 | /* Set to true if this instance of Emacs might dump. */ |
| 131 | #ifndef DOUG_LEA_MALLOC | ||
| 132 | static | ||
| 133 | #endif | ||
| 131 | bool might_dump; | 134 | bool might_dump; |
| 132 | 135 | ||
| 133 | #ifdef DARWIN_OS | 136 | #ifdef DARWIN_OS |
diff --git a/src/gmalloc.c b/src/gmalloc.c index ca862767bb2..282216a947b 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -56,7 +56,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. | |||
| 56 | extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); | 56 | extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); |
| 57 | extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void); | 57 | extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void); |
| 58 | extern void *(*__morecore) (ptrdiff_t); | 58 | extern void *(*__morecore) (ptrdiff_t); |
| 59 | extern void *__default_morecore (ptrdiff_t); | ||
| 60 | #endif | 59 | #endif |
| 61 | 60 | ||
| 62 | /* If HYBRID_MALLOC is defined, then temacs will use malloc, | 61 | /* If HYBRID_MALLOC is defined, then temacs will use malloc, |
| @@ -1512,8 +1511,8 @@ extern void *__sbrk (ptrdiff_t increment); | |||
| 1512 | /* Allocate INCREMENT more bytes of data space, | 1511 | /* Allocate INCREMENT more bytes of data space, |
| 1513 | and return the start of data space, or NULL on errors. | 1512 | and return the start of data space, or NULL on errors. |
| 1514 | If INCREMENT is negative, shrink data space. */ | 1513 | If INCREMENT is negative, shrink data space. */ |
| 1515 | void * | 1514 | static void * |
| 1516 | __default_morecore (ptrdiff_t increment) | 1515 | gdefault_morecore (ptrdiff_t increment) |
| 1517 | { | 1516 | { |
| 1518 | void *result; | 1517 | void *result; |
| 1519 | #ifdef HYBRID_MALLOC | 1518 | #ifdef HYBRID_MALLOC |
| @@ -1528,7 +1527,7 @@ __default_morecore (ptrdiff_t increment) | |||
| 1528 | return result; | 1527 | return result; |
| 1529 | } | 1528 | } |
| 1530 | 1529 | ||
| 1531 | void *(*__morecore) (ptrdiff_t) = __default_morecore; | 1530 | void *(*__morecore) (ptrdiff_t) = gdefault_morecore; |
| 1532 | 1531 | ||
| 1533 | /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. | 1532 | /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. |
| 1534 | 1533 | ||
diff --git a/src/lastfile.c b/src/lastfile.c index 2d0bcc76b8f..9c73fb44700 100644 --- a/src/lastfile.c +++ b/src/lastfile.c | |||
| @@ -38,7 +38,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 38 | 38 | ||
| 39 | #include "lisp.h" | 39 | #include "lisp.h" |
| 40 | 40 | ||
| 41 | #if ((!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined WINDOWSNT) \ | ||
| 42 | || defined CYGWIN || defined DARWIN_OS) | ||
| 41 | char my_edata[] = "End of Emacs initialized data"; | 43 | char my_edata[] = "End of Emacs initialized data"; |
| 44 | #endif | ||
| 42 | 45 | ||
| 43 | /* Help unexec locate the end of the .bss area used by Emacs (which | 46 | /* Help unexec locate the end of the .bss area used by Emacs (which |
| 44 | isn't always a separate section in NT executables). */ | 47 | isn't always a separate section in NT executables). */ |
diff --git a/src/lisp.h b/src/lisp.h index cafcfdef438..ef86c4fc958 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -619,7 +619,9 @@ extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object); | |||
| 619 | extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object); | 619 | extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object); |
| 620 | 620 | ||
| 621 | /* Defined in emacs.c. */ | 621 | /* Defined in emacs.c. */ |
| 622 | #ifdef DOUG_LEA_MALLOC | ||
| 622 | extern bool might_dump; | 623 | extern bool might_dump; |
| 624 | #endif | ||
| 623 | /* True means Emacs has already been initialized. | 625 | /* True means Emacs has already been initialized. |
| 624 | Used during startup to detect startup of dumped Emacs. */ | 626 | Used during startup to detect startup of dumped Emacs. */ |
| 625 | extern bool initialized; | 627 | extern bool initialized; |