gbranden pushed a commit to branch master
in repository groff.
commit 3d4f101e7b74dc7df9a98186bfdd283851e34797
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Mar 29 18:59:18 2026 -0500
[libgroff]: Slim library on non-Windows systems.
* src/libs/libgroff/relocate.cpp (searchpathext): Declare as `static`
since it does not require external linkage. Doing so reveals that the
function is not used at all except on Windows systems, so bracket with
preprocessor `#ifdef`/`#endif`, avoiding `-Wunused-function` warning
from GCC on GNU/Linux.
---
ChangeLog | 8 ++++++++
src/libs/libgroff/relocate.cpp | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index b089f030e..3a3a995b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-03-29 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/relocate.cpp (searchpathext): Declare as
+ `static` since it does not require external linkage. Doing so
+ reveals that the function is not used at all except on Windows
+ systems, so bracket with preprocessor `#ifdef`/`#endif`,
+ avoiding `-Wunused-function` warning from GCC on GNU/Linux.
+
2026-03-29 G. Branden Robinson <[email protected]>
* src/roff/groff/pipeline.c: Check for memory allocation
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 8b0760125..4ce2dea26 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -130,8 +130,10 @@ char *searchpath(const char *name, const char *pathp)
return 0;
}
+#ifdef _WIN32
// Search NAME along PATHP with the elements of PATHEXT in turn added.
-char *searchpathext(const char *name, const char *pathext, const char *pathp)
+static char *searchpathext(const char *name, const char *pathext,
+ const char *pathp)
{
char *found = 0;
char *tmpathext = strsave(pathext); // strtok modifies this string,
@@ -150,6 +152,7 @@ char *searchpathext(const char *name, const char *pathext,
const char *pathp)
delete[] tmpathext;
return found;
}
+#endif
// Convert an MS path to a POSIX path.
char *msw2posixpath(char *path)
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit