gbranden pushed a commit to branch master
in repository groff.
commit 1e7ea5487203988c0304d2788b35d002bc5e89f9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Apr 9 00:49:47 2026 -0500
[libgroff]: Drop "matherr.c" file.
...declaring (under the preprocessor conditions `HAVE_STRUCT_EXCEPTION`
and `TLOSS`) `matherr()` and `struct exception`. The former is K&R-
style, thus prohibited in ISO C23, and can (should) cause build failures
with compilers configured for that version of the C language. Autoconf
2.73, released last month, tries harder to arrange builds to use C23 by
default. Also we straight up don't _need_ this declaration (anymore);
nothing in groff calls `matherr()`. It dates back to the Clark days,
when there was no gnulib for groff to use (or maybe it didn't support
C++ projects at the time). Whatever gnulib needs, it transitively
closures for us, so we no longer need to and can throw this 30-year old
stuff of ours away.
* src/libs/libgroff/matherr.c: Delete.
* src/libs/libgroff/libgroff.am (libgroff_a_SOURCES): Drop
aforementioned file from macro definition.
Fixes <https://savannah.gnu.org/bugs/?68220>. Thanks to Alexis
Hildebrandt for the report. Also continues the long process of fixing
Savannah #66518.
src/libs/libgroff/.gitignore: Stop ignoring its compiled object file.
---
ChangeLog | 24 +++++++++++++++++++
src/libs/libgroff/.gitignore | 1 -
src/libs/libgroff/libgroff.am | 2 --
src/libs/libgroff/matherr.c | 55 -------------------------------------------
4 files changed, 24 insertions(+), 58 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d9d250b69..9a2dc2616 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2026-04-09 G. Branden Robinson <[email protected]>
+
+ [libgroff]: Drop "matherr.c" file, declaring (under the
+ preprocessor conditions `HAVE_STRUCT_EXCEPTION` and `TLOSS`)
+ `matherr()` and `struct exception`. The former is K&R-style,
+ thus prohibited in ISO C23, and can (should) cause build
+ failures with compilers configured for that version of the C
+ language. Autoconf 2.73, released last month, tries harder to
+ arrange builds to use C23 by default. Also we straight up don't
+ _need_ this declaration (anymore); nothing in groff calls
+ `matherr()`. It dates back to the Clark days, when there was no
+ gnulib for groff to use (or maybe it didn't support C++ projects
+ at the time). Whatever gnulib needs, it transitively closures
+ for us, so we no longer need to and can throw this 30-year old
+ stuff of ours away.
+
+ * src/libs/libgroff/matherr.c: Delete.
+ * src/libs/libgroff/libgroff.am (libgroff_a_SOURCES): Drop
+ aforementioned file from macro definition.
+
+ Fixes <https://savannah.gnu.org/bugs/?68220>. Thanks to Alexis
+ Hildebrandt for the report. Also continues the long process of
+ fixing Savannah #66518.
+
2026-04-08 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (space_size): Clarify warning
diff --git a/src/libs/libgroff/.gitignore b/src/libs/libgroff/.gitignore
index 764b0e7f8..a288cd3bf 100644
--- a/src/libs/libgroff/.gitignore
+++ b/src/libs/libgroff/.gitignore
@@ -28,7 +28,6 @@
/libgroff_a-lineno.o
/libgroff_a-localcharset.o
/libgroff_a-macropath.o
-/libgroff_a-matherr.o
/libgroff_a-maxfilename.o
/libgroff_a-maxpathname.o
/libgroff_a-mksdir.o
diff --git a/src/libs/libgroff/libgroff.am b/src/libs/libgroff/libgroff.am
index 25b705d2a..b49958096 100644
--- a/src/libs/libgroff/libgroff.am
+++ b/src/libs/libgroff/libgroff.am
@@ -47,7 +47,6 @@ libgroff_a_SOURCES = \
src/libs/libgroff/lineno.cpp \
src/libs/libgroff/localcharset.c \
src/libs/libgroff/macropath.cpp \
- src/libs/libgroff/matherr.c \
src/libs/libgroff/maxfilename.cpp \
src/libs/libgroff/maxpathname.cpp \
src/libs/libgroff/mksdir.cpp \
@@ -165,7 +164,6 @@ uninstall_charset_data:
$(RM) $(DESTDIR)$(libdir)/t-charset.alias; \
fi
-
# Local Variables:
# mode: makefile-automake
# fill-column: 72
diff --git a/src/libs/libgroff/matherr.c b/src/libs/libgroff/matherr.c
deleted file mode 100644
index b1ca4fcb6..000000000
--- a/src/libs/libgroff/matherr.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 1989-2020 Free Software Foundation, Inc.
-
-Written by James Clark ([email protected])
-
-This file is part of groff, the GNU roff typesetting system.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-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 <math.h>
-#include <errno.h>
-
-#ifdef HAVE_STRUCT_EXCEPTION
-#ifdef TLOSS
-
-int matherr(exc)
-struct exception *exc;
-{
- switch (exc->type) {
- case SING:
- case DOMAIN:
- errno = EDOM;
- break;
- case OVERFLOW:
- case UNDERFLOW:
- case TLOSS:
- case PLOSS:
- errno = ERANGE;
- break;
- }
- return 1;
-}
-
-#endif /* TLOSS */
-#endif /* HAVE_STRUCT_EXCEPTION */
-
-// Local Variables:
-// fill-column: 72
-// mode: C++
-// End:
-// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit