gbranden pushed a commit to branch master
in repository groff.

commit 703643c245989ecc9fda2f2b2bbe139318a45d5a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jul 1 18:47:18 2026 -0500

    [troff]: Tighten symbol visibility.
    
    * src/roff/troff/div.cpp (configure_page_offset_request)
    * src/roff/troff/env.cpp (compare_ranges)
      (hyphenation_character_request)
      (do_break_request)
      (input_trap)
      (input_trap_continued)
      (line_tabs_request)
      (sptoa):
    * src/roff/troff/input.cpp (exit_troff)
      (handle_initial_request)
      (do_string_case_transform)
      (get_file_line)
      (do_macro_source)
      (usage):
    * src/roff/troff/node.cpp (node_list_character_type)
      (node_list_vertical_extent): Define functions as `static`; they do not
      require external linkage.
    
    Fixes `-Wmissing-declarations` GCC warnings.
---
 ChangeLog                | 22 ++++++++++++++++++++++
 src/roff/troff/div.cpp   |  2 +-
 src/roff/troff/env.cpp   | 14 +++++++-------
 src/roff/troff/input.cpp | 14 +++++++-------
 src/roff/troff/node.cpp  |  4 ++--
 5 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7fc4c320d..08cf3dc3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2026-07-01  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/div.cpp (configure_page_offset_request)
+       * src/roff/troff/env.cpp (compare_ranges)
+       (hyphenation_character_request)
+       (do_break_request)
+       (input_trap)
+       (input_trap_continued)
+       (line_tabs_request)
+       (sptoa):
+       * src/roff/troff/input.cpp (exit_troff)
+       (handle_initial_request)
+       (do_string_case_transform)
+       (get_file_line)
+       (do_macro_source)
+       (usage):
+       * src/roff/troff/node.cpp (node_list_character_type)
+       (node_list_vertical_extent): Define functions as `static`; they
+       do not require external linkage.
+
+       Fixes `-Wmissing-declarations` GCC warnings.
+
 2026-07-02  G. Branden Robinson <[email protected]>
 
        [troff]: Refactor to kill off `ESCAPE_NEWLINE`.  There appears
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 1a56f4746..9fafa7235 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -753,7 +753,7 @@ diversion::~diversion()
 {
 }
 
-void configure_page_offset_request()
+static void configure_page_offset_request()
 {
   hunits n;
   // The troff manual says that the default scaling indicator is v,
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index cf21ff362..f73191eb8 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -260,7 +260,7 @@ int font_size::nranges = 0;
 
 extern "C" {
 
-int compare_ranges(const void *p1, const void *p2)
+static int compare_ranges(const void *p1, const void *p2)
 {
   return (  static_cast<size_range *>(const_cast<void *>(p1))->min
          - static_cast<size_range *>(const_cast<void *>(p2))->min);
@@ -1917,7 +1917,7 @@ void set_hyphenation_mode_default() // .hydefault
 
 // Set hyphenation character, which the input uses to mark the position
 // of a discretionary break ("dbreak") in a word.
-void hyphenation_character_request() // .hc
+static void hyphenation_character_request() // .hc
 {
   curenv->hyphen_indicator_char = read_character();
   // TODO?: If null pointer, set to ESCAPE_PERCENT, eliminating test(s)
@@ -2742,7 +2742,7 @@ bool environment::is_empty()
          && pending_lines == 0 /* nullptr */;
 }
 
-void do_break_request(bool want_adjustment)
+static void do_break_request(bool want_adjustment)
 {
   while (!tok.is_terminator())
     tok.next();
@@ -2893,12 +2893,12 @@ void do_input_trap(bool respect_continuation)
   skip_line();
 }
 
-void input_trap() // .it
+static void input_trap() // .it
 {
   do_input_trap(false);
 }
 
-void input_trap_continued() // .itc
+static void input_trap_continued() // .itc
 {
   do_input_trap(true);
 }
@@ -3174,7 +3174,7 @@ static void field_characters_request() // .fc
   skip_line();
 }
 
-void line_tabs_request() // .linetabs
+static void line_tabs_request() // .linetabs
 {
   int n;
   if (has_arg() && read_integer(&n))
@@ -3561,7 +3561,7 @@ const char *environment::get_name_string()
 
 // Convert a quantity in scaled points to ascii decimal fraction.
 
-const char *sptoa(int sp)
+static const char *sptoa(int sp)
 {
   assert(sp > 0);
   assert(sizescale > 0);
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 2741df64e..48a64044c 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3374,7 +3374,7 @@ static symbol read_input_until_terminator(bool 
want_diagnostic,
 
 static void close_all_streams();
 
-void exit_troff()
+static void exit_troff()
 {
   is_exit_underway = true;
   close_all_streams();
@@ -5551,7 +5551,7 @@ void push_page_ejector()
   input_stack::push(make_temp_iterator(buf));
 }
 
-void handle_initial_request(unsigned char code)
+static void handle_initial_request(unsigned char code)
 {
   char buf[2];
   buf[0] = code;
@@ -5851,7 +5851,7 @@ static void chop_request() // .chop
 enum case_xform_mode { STRING_UPCASE, STRING_DOWNCASE };
 
 // Case-transform each byte of the string argument's contents.
-void do_string_case_transform(case_xform_mode mode)
+static void do_string_case_transform(case_xform_mode mode)
 {
   assert((STRING_DOWNCASE == mode) || (STRING_UPCASE == mode));
   symbol s = read_identifier();
@@ -7181,7 +7181,7 @@ void device_extension_node::tprint(troff_output_file *out)
   tprint_end(out);
 }
 
-int get_file_line(const char **filename, int *lineno)
+static int get_file_line(const char **filename, int *lineno)
 {
   return input_stack::get_location(false /* allow macro */, filename,
                                   lineno);
@@ -7597,7 +7597,7 @@ static void while_continue_request() // .continue
   }
 }
 
-void do_source(bool quietly)
+static void do_source(bool quietly)
 {
   char *filename = read_rest_of_line_as_argument();
   errno = 0;
@@ -9874,7 +9874,7 @@ static void process_startup_file(const char *filename)
   mac_path = orig_mac_path;
 }
 
-void do_macro_source(bool quietly)
+static void do_macro_source(bool quietly)
 {
   char *macro_filename = read_rest_of_line_as_argument();
   char *path;
@@ -10023,7 +10023,7 @@ static void add_string(const char *s, string_list **p)
   *p = new string_list(s);
 }
 
-void usage(FILE *stream, const char *prog)
+static void usage(FILE *stream, const char *prog)
 {
   fprintf(stream,
 "usage: %s [-abcCEiRSUz] [-d ctext] [-d string=text] [-f font-family]"
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 89d6f1e2c..f3d41f0f0 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3395,7 +3395,7 @@ node *zero_width_node::copy()
                             div_nest_level);
 }
 
-int node_list_character_type(node *p)
+static int node_list_character_type(node *p)
 {
   int t = 0;
   for (; p != 0 /* nullptr */; p = p->next)
@@ -3408,7 +3408,7 @@ int zero_width_node::character_type()
   return node_list_character_type(nodes);
 }
 
-void node_list_vertical_extent(node *p, vunits *min, vunits *max)
+static void node_list_vertical_extent(node *p, vunits *min, vunits *max)
 {
   *min = V0;
   *max = V0;

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to