* configure.ac (WERROR_CFLAGS): Don't disable -Wnested-externs.
While we're at it, don't disable -Wlogical-op either.
* src/bytecode.c: Include blockinput.h and keyboard.h rather
than rolling their APIs by hand.
* src/emacs.c: Include regex.h and rely on its and lisp.h's API
rather than rolling them by hand.
* src/lastfile.c: Include lisp.h, to check this file's API.
* src/lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
New decls.
* src/regex.h (re_max_failures): New decl.
* src/unexcw.c, src/unexmacosx.c, src/unexw32.c:
Rely on lisp.h's API rather than rolling it by hand.
* src/vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
Declare at top level, to pacify GCC -Wnested-externs.
+2014-09-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Clean up extern decls a bit.
+ * configure.ac (WERROR_CFLAGS): Don't disable -Wnested-externs.
+ While we're at it, don't disable -Wlogical-op either.
+
2014-08-31 Paul Eggert <eggert@cs.ucla.edu>
* configure.ac (MAKE): Export it, for config.status.
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Woverlength-strings" # Not a problem these days
- nw="$nw -Wlogical-op" # any use of fwrite provokes this
nw="$nw -Wformat-nonliteral" # we do this a lot
- nw="$nw -Wvla" # warnings in gettext.h
- nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
+ nw="$nw -Wvla" # Emacs uses <vla.h>.
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Winline" # OK to ignore 'inline'
nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
# Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector"
- # The following line should be removable at some point.
+ # Emacs's use of partly-pure functions such as CHECK_TYPE make this
+ # option problematic.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
gl_WARN_ADD([-Wno-format-nonliteral])
- # In spite of excluding -Wlogical-op above, it is enabled, as of
- # gcc 4.5.0 20090517.
- gl_WARN_ADD([-Wno-logical-op])
-
# More things that clang is unduly picky about.
if test $emacs_cv_clang = yes; then
gl_WARN_ADD([-Wno-format-extra-args])
+2014-09-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ Clean up extern decls a bit.
+ * bytecode.c: Include blockinput.h and keyboard.h rather
+ than rolling their APIs by hand.
+ * emacs.c: Include regex.h and rely on its and lisp.h's API
+ rather than rolling them by hand.
+ * lastfile.c: Include lisp.h, to check this file's API.
+ * lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
+ New decls.
+ * regex.h (re_max_failures): New decl.
+ * unexcw.c, unexmacosx.c, unexw32.c:
+ Rely on lisp.h's API rather than rolling it by hand.
+ * vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
+ Declare at top level, to pacify GCC -Wnested-externs.
+
2014-08-31 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (get_glyph_string_clip_rects): Don't let the width of a
#include <config.h>
#include "lisp.h"
+#include "blockinput.h"
#include "character.h"
#include "buffer.h"
+#include "keyboard.h"
#include "syntax.h"
#include "window.h"
goto pushhandler;
CASE (Bpushconditioncase): /* New in 24.4. */
{
- extern EMACS_INT lisp_eval_depth;
- extern int poll_suppress_count;
- extern int interrupt_input_blocked;
struct handler *c;
Lisp_Object tag;
int dest;
#include "charset.h"
#include "composite.h"
#include "dispextern.h"
+#include "regex.h"
#include "syntax.h"
#include "sysselect.h"
#include "systime.h"
#ifdef GNU_LINUX
if (!initialized)
{
- extern char my_endbss[];
- extern char *my_endbss_static;
-
if (my_heap_start == 0)
my_heap_start = sbrk (0);
&& !getrlimit (RLIMIT_STACK, &rlim))
{
long newlim;
- extern size_t re_max_failures;
/* Approximate the amount regex.c needs per unit of re_max_failures. */
int ratio = 20 * sizeof (char *);
/* Then add 33% to cover the size of the smaller stacks that regex.c
#ifndef WINDOWSNT
/* On Windows, this was done before dumping, and that once suffices.
Meanwhile, my_edata is not valid on Windows. */
- {
- extern char my_edata[];
- memory_warnings (my_edata, malloc_warning);
- }
+ memory_warnings (my_edata, malloc_warning);
#endif /* not WINDOWSNT */
#endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */
#ifdef DOUG_LEA_MALLOC
#include <config.h>
+#include <lisp.h>
+
char my_edata[] = "End of Emacs initialized data";
/* Help unexec locate the end of the .bss area used by Emacs (which
}
/* Defined in eval.c. */
+extern EMACS_INT lisp_eval_depth;
extern Lisp_Object Qexit, Qinteractive, Qcommandp, Qmacro;
extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure;
extern Lisp_Object Qand_rest;
extern char *emacs_root_dir (void);
#endif /* DOS_NT */
+/* Defined in lastfile.c. */
+extern char my_edata[];
+extern char my_endbss[];
+extern char *my_endbss_static;
+
/* True means ^G can quit instantly. */
extern bool immediate_quit;
extern Lisp_Object re_match_object;
#endif
+/* Roughly the maximum number of failure points on the stack. */
+extern size_t re_max_failures;
+
\f
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
extern int bss_sbrk_did_unexec;
-/* emacs symbols that indicate where bss and data end for emacs internals */
-extern char my_endbss[];
-extern char my_edata[];
-
/*
** header for Windows executable files
*/
file. */
if (strncmp (sectp->sectname, SECT_DATA, 16) == 0)
{
- extern char my_edata[];
unsigned long my_size;
/* The __data section is basically dumped from memory. But
}
else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0)
{
- extern char *my_endbss_static;
unsigned long my_size;
sectp->flags = S_REGULAR;
extern BOOL ctrl_c_handler (unsigned long type);
extern char my_begdata[];
-extern char my_edata[];
extern char my_begbss[];
-extern char my_endbss[];
extern char *my_begbss_static;
-extern char *my_endbss_static;
#include "w32heap.h"
# endif
#endif
+/* From gmalloc.c. */
+extern void (* __after_morecore_hook) (void);
+extern void *(*__morecore) (ptrdiff_t);
+
+/* From ralloc.c. */
+#ifdef REL_ALLOC
+extern void *(*real_morecore) (ptrdiff_t);
+#endif
+
/*
Level number of warnings already issued.
0 -- no warnings issued.
static void
check_memory_limits (void)
{
-#ifdef REL_ALLOC
- extern void *(*real_morecore) (ptrdiff_t);
-#else
+#ifndef REL_ALLOC
void *(*real_morecore) (ptrdiff_t) = 0;
#endif
- extern void *(*__morecore) (ptrdiff_t);
char *cp;
size_t five_percent;
void
memory_warnings (void *start, void (*warnfun) (const char *))
{
- extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
-
data_space_start = start ? start : data_start;
warn_function = warnfun;