groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 13/13: [build]: Fix Savannah #64910 ({assert,config}.h).


From: G. Branden Robinson
Subject: [groff] 13/13: [build]: Fix Savannah #64910 ({assert,config}.h).
Date: Mon, 20 Nov 2023 02:11:50 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit b28d9d05cac409842cd6387b544e39d36d9c3c01
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Nov 20 00:00:59 2023 -0600

    [build]: Fix Savannah #64910 ({assert,config}.h).
    
    In source files that #include <assert.h>, ensure that we #include
    <config.h> first (with a `HAVE_CONFIG_H` inclusion guard).  This should
    prevent build failures on AIX a.k.a. z/OS.
    
    * src/devices/grodvi/dvi.cpp:
    * src/devices/grolbp/lbp.cpp:
    * src/devices/grolj4/lj4.cpp:
    * src/include/itable.h:
    * src/include/ptable.h:
    * src/include/stringclass.h:
    * src/libs/libbib/linear.cpp:
    * src/libs/libbib/search.cpp:
    * src/libs/libdriver/printer.cpp:
    * src/libs/libgroff/color.cpp:
    * src/libs/libgroff/font.cpp:
    * src/libs/libgroff/fontfile.cpp:
    * src/libs/libgroff/nametoindex.cpp:
    * src/libs/libgroff/relocate.cpp:
    * src/libs/libgroff/searchpath.cpp:
    * src/preproc/eqn/box.cpp:
    * src/preproc/eqn/delim.cpp:
    * src/preproc/eqn/pile.cpp:
    * src/preproc/eqn/script.cpp:
    * src/preproc/html/pre-html.cpp:
    * src/preproc/pic/pic.h:
    * src/preproc/preconv/preconv.cpp:
    * src/preproc/soelim/soelim.cpp:
    * src/roff/groff/groff.cpp:
    * src/roff/troff/troff.h:
    * src/utils/hpftodit/hpftodit.cpp:
    * src/utils/indxbib/indxbib.cpp:
    * src/utils/lkbib/lkbib.cpp:
    * src/utils/lookbib/lookbib.cpp:
    * src/utils/tfmtodit/tfmtodit.cpp: Do it.
    
    Fixes <https://savannah.gnu.org/bugs/?64910>.  Also see
    <https://savannah.gnu.org/bugs/?61315>.  Thanks to Mike Fulton for the
    report.
    
    Also:
    
    * src/roff/troff/troff.h: Drop old style Emacs file-local variable
      setting.
---
 ChangeLog                         | 41 +++++++++++++++++++++++++++++++++++++++
 src/devices/grodvi/dvi.cpp        |  4 ++++
 src/devices/grolbp/lbp.cpp        |  4 ++++
 src/devices/grolj4/lj4.cpp        |  4 ++++
 src/include/itable.h              |  4 ++++
 src/include/ptable.h              |  4 ++++
 src/include/stringclass.h         |  4 ++++
 src/libs/libbib/linear.cpp        |  4 ++++
 src/libs/libbib/search.cpp        |  4 ++++
 src/libs/libdriver/printer.cpp    |  4 ++++
 src/libs/libgroff/color.cpp       |  4 ++++
 src/libs/libgroff/font.cpp        |  4 ++++
 src/libs/libgroff/fontfile.cpp    |  4 ++++
 src/libs/libgroff/nametoindex.cpp |  4 ++++
 src/libs/libgroff/relocate.cpp    |  4 ++++
 src/libs/libgroff/searchpath.cpp  |  4 ++++
 src/preproc/eqn/box.cpp           |  4 ++++
 src/preproc/eqn/delim.cpp         |  4 ++++
 src/preproc/eqn/pile.cpp          |  4 ++++
 src/preproc/eqn/script.cpp        |  4 ++++
 src/preproc/html/pre-html.cpp     |  4 ++++
 src/preproc/pic/pic.h             |  4 ++++
 src/preproc/preconv/preconv.cpp   |  4 ++++
 src/preproc/soelim/soelim.cpp     |  4 ++++
 src/roff/groff/groff.cpp          |  4 ++++
 src/roff/troff/troff.h            |  6 ++++--
 src/utils/hpftodit/hpftodit.cpp   |  4 ++++
 src/utils/indxbib/indxbib.cpp     |  4 ++++
 src/utils/lkbib/lkbib.cpp         |  4 ++++
 src/utils/lookbib/lookbib.cpp     |  4 ++++
 src/utils/tfmtodit/tfmtodit.cpp   |  4 ++++
 31 files changed, 161 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c19873658..0eb95dbf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2023-11-19  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [build]: In source files that #include <assert.h>, ensure that
+       we #include <config.h> first (with a `HAVE_CONFIG_H` inclusion
+       guard).  This should prevent build failures on AIX a.k.a. z/OS.
+
+       * src/devices/grodvi/dvi.cpp:
+       * src/devices/grolbp/lbp.cpp:
+       * src/devices/grolj4/lj4.cpp:
+       * src/include/itable.h:
+       * src/include/ptable.h:
+       * src/include/stringclass.h:
+       * src/libs/libbib/linear.cpp:
+       * src/libs/libbib/search.cpp:
+       * src/libs/libdriver/printer.cpp:
+       * src/libs/libgroff/color.cpp:
+       * src/libs/libgroff/font.cpp:
+       * src/libs/libgroff/fontfile.cpp:
+       * src/libs/libgroff/nametoindex.cpp:
+       * src/libs/libgroff/relocate.cpp:
+       * src/libs/libgroff/searchpath.cpp:
+       * src/preproc/eqn/box.cpp:
+       * src/preproc/eqn/delim.cpp:
+       * src/preproc/eqn/pile.cpp:
+       * src/preproc/eqn/script.cpp:
+       * src/preproc/html/pre-html.cpp:
+       * src/preproc/pic/pic.h:
+       * src/preproc/preconv/preconv.cpp:
+       * src/preproc/soelim/soelim.cpp:
+       * src/roff/groff/groff.cpp:
+       * src/roff/troff/troff.h:
+       * src/utils/hpftodit/hpftodit.cpp:
+       * src/utils/indxbib/indxbib.cpp:
+       * src/utils/lkbib/lkbib.cpp:
+       * src/utils/lookbib/lookbib.cpp:
+       * src/utils/tfmtodit/tfmtodit.cpp: Do it.
+
+       Fixes <https://savannah.gnu.org/bugs/?64910>.  Also see
+       <https://savannah.gnu.org/bugs/?61315>.  Thanks to Mike Fulton
+       for the report.
+
 2023-11-14  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/number.cpp: Rename some enumeration constants.
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index 8e285ea30..1dac6d88f 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "driver.h"
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index 35cd54e0a..b37c90055 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -23,6 +23,10 @@ TODO
  - Add X command to include bitmaps
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "driver.h"
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index a429a7d06..1a238ae4e 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -30,6 +30,10 @@ X command to specify inline escape sequence (how to specify 
unprintable chars?)
 X command to include bitmap graphics
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "driver.h"
diff --git a/src/include/itable.h b/src/include/itable.h
index c97db5597..e3190c512 100644
--- a/src/include/itable.h
+++ b/src/include/itable.h
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 // 'class ITABLE(T)' is the type of a hash table mapping an integer (int >= 0)
diff --git a/src/include/ptable.h b/src/include/ptable.h
index fa792936b..36d1f4540 100644
--- a/src/include/ptable.h
+++ b/src/include/ptable.h
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <string.h>
 
diff --git a/src/include/stringclass.h b/src/include/stringclass.h
index ca0bf854a..b9245e10d 100644
--- a/src/include/stringclass.h
+++ b/src/include/stringclass.h
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/src/libs/libbib/linear.cpp b/src/libs/libbib/linear.cpp
index 22e11d8e7..13a28148c 100644
--- a/src/libs/libbib/linear.cpp
+++ b/src/libs/libbib/linear.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <errno.h>
diff --git a/src/libs/libbib/search.cpp b/src/libs/libbib/search.cpp
index 10867b6d5..222acf3bf 100644
--- a/src/libs/libbib/search.cpp
+++ b/src/libs/libbib/search.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <errno.h>
diff --git a/src/libs/libdriver/printer.cpp b/src/libs/libdriver/printer.cpp
index c70117f5b..e0ae69226 100644
--- a/src/libs/libdriver/printer.cpp
+++ b/src/libs/libdriver/printer.cpp
@@ -17,6 +17,10 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "driver.h"
diff --git a/src/libs/libgroff/color.cpp b/src/libs/libgroff/color.cpp
index 32a1bc8e7..cc4498f44 100644
--- a/src/libs/libgroff/color.cpp
+++ b/src/libs/libgroff/color.cpp
@@ -20,6 +20,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include "color.h"
 #include "cset.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index c1af12ca9..ab5efb2e4 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <math.h>
diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp
index 42e066613..7585fc55d 100644
--- a/src/libs/libgroff/fontfile.cpp
+++ b/src/libs/libgroff/fontfile.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h> // assert()
 #include <stdio.h> // snprintf()
 #include <string.h> // strchr(), strlen()
diff --git a/src/libs/libgroff/nametoindex.cpp 
b/src/libs/libgroff/nametoindex.cpp
index 095a432ef..89cf34aee 100644
--- a/src/libs/libgroff/nametoindex.cpp
+++ b/src/libs/libgroff/nametoindex.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <stdlib.h>
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 32a0e2ef3..59dd90a7b 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -18,6 +18,10 @@
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp
index 6062e8d4e..2042218d8 100644
--- a/src/libs/libgroff/searchpath.cpp
+++ b/src/libs/libgroff/searchpath.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp
index 7e455ef69..5000e5787 100644
--- a/src/preproc/eqn/box.cpp
+++ b/src/preproc/eqn/box.cpp
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "eqn.h"
diff --git a/src/preproc/eqn/delim.cpp b/src/preproc/eqn/delim.cpp
index 25f0b02fb..452826c13 100644
--- a/src/preproc/eqn/delim.cpp
+++ b/src/preproc/eqn/delim.cpp
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "eqn.h"
diff --git a/src/preproc/eqn/pile.cpp b/src/preproc/eqn/pile.cpp
index ab1f2c371..30203231d 100644
--- a/src/preproc/eqn/pile.cpp
+++ b/src/preproc/eqn/pile.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 // piles and matrices
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "eqn.h"
diff --git a/src/preproc/eqn/script.cpp b/src/preproc/eqn/script.cpp
index 34fe1fe74..92ed1c4cf 100644
--- a/src/preproc/eqn/script.cpp
+++ b/src/preproc/eqn/script.cpp
@@ -16,6 +16,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 
 #include "eqn.h"
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 537efe3c3..69288ea9f 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -23,6 +23,10 @@
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h
index 1a99498a4..e6bc71d2c 100644
--- a/src/preproc/pic/pic.h
+++ b/src/preproc/pic/pic.h
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <math.h>
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index 485574dda..cc661c525 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <errno.h>
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index bafc5cd02..685a883e4 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 935793e4f..5b7dda551 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -20,6 +20,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <signal.h>
diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h
index 9355297c7..e687464ce 100644
--- a/src/roff/troff/troff.h
+++ b/src/roff/troff/troff.h
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /* Copyright (C) 1989-2020 Free Software Foundation, Inc.
      Written by James Clark (jjc@jclark.com)
 
@@ -17,9 +16,12 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index 4982e1988..a617ff047 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -25,6 +25,10 @@ put filename in error messages (or fix lib)
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <ctype.h>
 #include <errno.h>
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index ad8bb0ecd..59c266780 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index 946bd7dc7..7bdf6cc24 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp
index d8556c629..6469b313b 100644
--- a/src/utils/lookbib/lookbib.cpp
+++ b/src/utils/lookbib/lookbib.cpp
@@ -18,6 +18,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index 437e47e08..b5967963d 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -48,6 +48,10 @@ both be zero. */
 
 #include "lib.h"
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <errno.h>
 #include <math.h>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]