diff --git a/lib-src/etags.c b/lib-src/etags.c index 84dfa527e98..03bc55de03d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -705,7 +705,7 @@ and optionally Prolog-like definitions (first rule for a predicate or \ function).\n\ To enable this behavior, run etags using --declarations."; static bool with_mercury_definitions = false; -float mercury_heuristics_ratio = MERCURY_HEURISTICS_RATIO; +static float mercury_heuristics_ratio = MERCURY_HEURISTICS_RATIO; static const char *Objc_suffixes [] = { "lm", /* Objective lex file */ diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index ac4f320f9a5..ee589e03397 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -660,11 +660,11 @@ close_emacs_globals (ptrdiff_t num_symbols) printf (("};\n" "extern struct emacs_globals globals;\n" "\n" - "#ifndef DEFINE_SYMBOLS\n" - "extern\n" - "#endif\n" - "struct Lisp_Symbol lispsym[%td];\n"), - num_symbols); + "extern struct Lisp_Symbol lispsym[%td];\n" + "#ifdef DEFINE_SYMBOLS\n" + "struct Lisp_Symbol lispsym[%td];\n" + "#endif\n"), + num_symbols, num_symbols); } static void diff --git a/src/alloc.c b/src/alloc.c index 4226cb1d1a0..28e32554472 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -8338,7 +8338,7 @@ enum defined_HAVE_PGTK { defined_HAVE_PGTK = false }; then xbacktrace could fail. Similarly for the other enums and their values. Some non-GCC compilers don't like these constructs. */ #ifdef __GNUC__ -union +extern union enums_for_gdb { enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; enum char_table_specials char_table_specials; @@ -8353,5 +8353,6 @@ union enum pvec_type pvec_type; enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS; enum defined_HAVE_PGTK defined_HAVE_PGTK; -} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; +} const gdb_make_enums_visible; +union enums_for_gdb const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; #endif /* __GNUC__ */ diff --git a/src/emacs.c b/src/emacs.c index 22da39a4d1c..58c751eaa6a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -166,6 +166,7 @@ static const char emacs_copyright[] = COPYRIGHT; static const char emacs_bugreport[] = PACKAGE_BUGREPORT; /* Put version info into the executable in the form that 'ident' uses. */ +extern char const RCS_Id[]; char const EXTERNALLY_VISIBLE RCS_Id[] = "$Id" ": GNU Emacs " PACKAGE_VERSION " (" EMACS_CONFIGURATION " " EMACS_CONFIG_FEATURES ") $"; diff --git a/src/keyboard.c b/src/keyboard.c index bd1bb3bb4be..2995b3f906c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3650,6 +3650,7 @@ readable_events (int flags) } /* Set this for debugging, to have a way to get out */ +extern int stop_character; int stop_character EXTERNALLY_VISIBLE; static KBOARD * diff --git a/src/lisp.h b/src/lisp.h index 010d63e4dd9..41f8af35e8a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -55,7 +55,8 @@ INLINE_HEADER_BEGIN #define DECLARE_GDB_SYM(type, id) type const id EXTERNALLY_VISIBLE #ifdef MAIN_PROGRAM -# define DEFINE_GDB_SYMBOL_BEGIN(type, id) DECLARE_GDB_SYM (type, id) +# define DEFINE_GDB_SYMBOL_BEGIN(type, id) \ + extern DECLARE_GDB_SYM (type, id); DECLARE_GDB_SYM (type, id) # define DEFINE_GDB_SYMBOL_END(id) = id; #else # define DEFINE_GDB_SYMBOL_BEGIN(type, id) extern DECLARE_GDB_SYM (type, id) @@ -4435,6 +4436,7 @@ extern void parse_str_as_multibyte (const unsigned char *, ptrdiff_t, ptrdiff_t *, ptrdiff_t *); /* Defined in alloc.c. */ +extern intptr_t garbage_collection_inhibited; extern void *my_heap_start (void); extern void check_pure_size (void); unsigned char *resize_string_data (Lisp_Object, ptrdiff_t, int, int); diff --git a/src/pgtkselect.c b/src/pgtkselect.c index b0ab15c6069..271411b87ca 100644 --- a/src/pgtkselect.c +++ b/src/pgtkselect.c @@ -353,7 +353,7 @@ struct pgtk_selection_request /* Stack of selections currently being processed. NULL if all requests have been fully processed. */ -struct pgtk_selection_request *selection_request_stack; +static struct pgtk_selection_request *selection_request_stack; static void pgtk_push_current_selection_request (struct selection_input_event *se, diff --git a/src/print.c b/src/print.c index 612d63b7e94..7aacd2b2e90 100644 --- a/src/print.c +++ b/src/print.c @@ -90,6 +90,7 @@ static ptrdiff_t print_number_index; static void print_interval (INTERVAL interval, void *pprintcharfun); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ +extern bool print_output_debug_flag; bool print_output_debug_flag EXTERNALLY_VISIBLE = 1; diff --git a/src/xdisp.c b/src/xdisp.c index a7cae804006..4b7d7e02c68 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13195,8 +13195,6 @@ truncate_message_1 (void *a1, Lisp_Object a2) return false; } -extern intptr_t garbage_collection_inhibited; - /* Set the current message to STRING. */ static void diff --git a/src/xselect.c b/src/xselect.c index fd0f06eeed9..6578358adc0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -562,12 +562,12 @@ struct x_selection_request /* Stack of selections currently being processed. NULL if all requests have been fully processed. */ -struct x_selection_request *selection_request_stack; +static struct x_selection_request *selection_request_stack; /* List of all outstanding selection transfers which are currently being processed. */ -struct transfer outstanding_transfers; +static struct transfer outstanding_transfers; /* A counter for selection serials. */ diff --git a/src/xterm.c b/src/xterm.c index 33ef18d8da5..11ef9a4bd94 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -971,7 +971,7 @@ struct x_selection_request_event selection requests inside long-lasting modal event loops, such as the drag-and-drop loop. */ -struct x_selection_request_event *pending_selection_requests; +static struct x_selection_request_event *pending_selection_requests; struct x_atom_ref { @@ -1274,7 +1274,7 @@ static int x_dnd_waiting_for_motif_finish; /* The display the Motif drag receiver will send response data from. */ -struct x_display_info *x_dnd_waiting_for_motif_finish_display; +static struct x_display_info *x_dnd_waiting_for_motif_finish_display; /* Whether or not F1 was pressed during the drag-and-drop operation. @@ -31921,8 +31921,6 @@ x_activate_timeout_atimer (void) /* Set up use of X before we make the first connection. */ -extern frame_parm_handler x_frame_parm_handlers[]; - static struct redisplay_interface x_redisplay_interface = { x_frame_parm_handlers, diff --git a/src/xterm.h b/src/xterm.h index 437ef281b0c..bf402de326b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1727,6 +1727,7 @@ SELECTION_EVENT_DISPLAY (struct selection_input_event *ev) /* From xfns.c. */ +extern frame_parm_handler x_frame_parm_handlers[]; extern void x_free_gcs (struct frame *); extern void x_relative_mouse_position (struct frame *, int *, int *); extern void x_real_pos_and_offsets (struct frame *, int *, int *, int *,