Pacify gcc -Wmissing-variable-declarations

This is a new warning diagnostic in GCC 14.
* lib-src/etags.c (mercury_heuristics_ratio):
* src/pgtkselect.c, src/xselect.c (selection_request_stack):
* src/xselect.c (outstanding_transfers):
* src/xterm.c (pending_selection_requests)
(x_dnd_waiting_for_motif_finish_display):
Now static.
* lib-src/make-docfile.c (close_emacs_globals):
Arrange for lispsym to be declared with extern first,
when compiling lread.c.
* src/alloc.c (gdb_make_enums_visible) [__GNUC__]:
* src/emacs.c (RCS_Id):
* src/keyboard.c (stop_character):
* src/print.c (print_output_debug_flag):
Now declared with extern first.
* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN) [MAIN_PROGRAM]:
Arrange for ID to be declared extern first.
* src/lisp.h (garbage_collection_inhibited):
* src/xterm.h (x_frame_parm_handlers):
Declare here, so that its interface is properly checked.  Other decls
removed.
This commit is contained in:
Paul Eggert 2024-05-04 10:08:48 -07:00
parent 7ae091d933
commit 99a5c75f3b
12 changed files with 21 additions and 18 deletions

View file

@ -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 */

View file

@ -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

View file

@ -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__ */

View file

@ -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 ") $";

View file

@ -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 *

View file

@ -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);

View file

@ -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,

View file

@ -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;

View file

@ -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

View file

@ -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. */

View file

@ -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,

View file

@ -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 *,