gbranden pushed a commit to branch master
in repository groff.
commit 524f1e4b9397dce40b4659b64c2debe0aaa421b0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 10 08:00:43 2025 -0600
Retire our fmod(3) replacement.
...in favor of gnulib's. James Clark wrote groff's in 1989; it's
changed very little since.
* Makefile.am: Drop fmod-referencing annotations.
* bootstrap.conf (gnulib_modules): Add "fmod".
* configure.ac: Drop `fmod` from `AC_REPLACE_FUNCS()` call.
* src/libs/libgroff/fmod.c: Delete.
* src/libs/libgroff/libgroff.am (EXTRA_DIST): Drop "fmod.c".
* src/preproc/pic/pic.ypp: Drop conditional declaration of `fmod()`
symbol.
Continues fixing Savannah #66518.
---
ChangeLog | 15 +++++++++++++++
Makefile.am | 3 +--
bootstrap.conf | 1 +
configure.ac | 2 +-
src/libs/libgroff/fmod.c | 36 ------------------------------------
src/libs/libgroff/libgroff.am | 1 -
src/preproc/pic/pic.ypp | 6 ------
7 files changed, 18 insertions(+), 46 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dd145ed1d..bb19377db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2025-11-10 G. Branden Robinson <[email protected]>
+
+ Retire our fmod(3) replacement in favor of gnulib's. James
+ Clark wrote groff's in 1989; it's changed very little since.
+
+ * Makefile.am: Drop fmod-referencing annotations.
+ * bootstrap.conf (gnulib_modules): Add "fmod".
+ * configure.ac: Drop `fmod` from `AC_REPLACE_FUNCS()` call.
+ * src/libs/libgroff/fmod.c: Delete.
+ * src/libs/libgroff/libgroff.am (EXTRA_DIST): Drop "fmod.c".
+ * src/preproc/pic/pic.ypp: Drop conditional declaration of
+ `fmod()` symbol.
+
+ Continues fixing Savannah #66518.
+
2025-11-07 G. Branden Robinson <[email protected]>
Retire our putenv(3) replacement in favor of gnulib's. groff's
diff --git a/Makefile.am b/Makefile.am
index e1a4d65c7..615623632 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -294,7 +294,6 @@ man7dir=$(manroot)/man$(man7ext)
# HAVE_SYS_TYPES_H if you have <sys/types.h>
# HAVE_UNISTD_H if you have <unistd.h>
#
-# HAVE_FMOD if you have fmod()
# HAVE_GETCWD if you have getcwd()
# HAVE_GETTIMEOFDAY if you have gettimeofday()
# HAVE_ICONV if you have iconv()
@@ -352,7 +351,7 @@ man7dir=$(manroot)/man$(man7ext)
# Include
#
-# {fmod,getcwd,mkstemp,
+# {getcwd,mkstemp,
# strerror,strtol}.$(OBJEXT)
#
# in 'LIBOBJS' if your C library is missing the corresponding function.
diff --git a/bootstrap.conf b/bootstrap.conf
index 9780f515f..c6c8ba9f5 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -42,6 +42,7 @@ gnulib_modules="
havelib
memmem
wcwidth
+ fmod
fprintf-posix
snprintf
vsnprintf
diff --git a/configure.ac b/configure.ac
index 4c065f08e..279605642 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@ AC_SUBST([LIBEXT],[$acl_libext])
AC_FUNC_MMAP
saved_libs="$LIBS"
LIBS="$LIBS $LIBC $LIBM"
-AC_REPLACE_FUNCS([fmod getcwd strtol])
+AC_REPLACE_FUNCS([getcwd strtol])
LIBS="$saved_libs"
AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strdup \
strsep])
diff --git a/src/libs/libgroff/fmod.c b/src/libs/libgroff/fmod.c
deleted file mode 100644
index 15a9eaeaf..000000000
--- a/src/libs/libgroff/fmod.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
- Written by James Clark ([email protected])
-
-This file is part of groff.
-
-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>
-
-double fmod(x, y)
- double x, y;
-{
- double quot = x/y;
- return x - (quot < 0.0 ? ceil(quot) : floor(quot)) * y;
-}
-
-// Local Variables:
-// fill-column: 72
-// mode: C++
-// End:
-// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/libgroff.am b/src/libs/libgroff/libgroff.am
index eb30f026b..8a0721e79 100644
--- a/src/libs/libgroff/libgroff.am
+++ b/src/libs/libgroff/libgroff.am
@@ -81,7 +81,6 @@ libgroff_a_LIBADD = lib/libgnu.a
# TODO: these .c files could be removed (use gnulib instead).
EXTRA_DIST += \
src/libs/libgroff/mkstemp.cpp \
- src/libs/libgroff/fmod.c \
src/libs/libgroff/getcwd.c \
src/libs/libgroff/strtol.c \
src/libs/libgroff/config.charset \
diff --git a/src/preproc/pic/pic.ypp b/src/preproc/pic/pic.ypp
index fdd0d197f..2ccc1e3aa 100644
--- a/src/preproc/pic/pic.ypp
+++ b/src/preproc/pic/pic.ypp
@@ -47,12 +47,6 @@ extern "C" {
}
#endif /* NEED_DECLARATION_SRAND */
-#ifndef HAVE_FMOD
-extern "C" {
- double fmod(double, double);
-}
-#endif
-
#include "pic.h"
#include "ptable.h"
#include "object.h"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit