NULL is best for C as discussed - for coreutils - at:
https://bugs.gnu.org/66221#53
* bootstrap.conf: Remove dependency on nullptr.
* s/nullptr/NULL/.
This effectively reverts 93ce19f0d5a1.
The .HP macro introduced only recently triggers a 'make check' errors:
env GROFF=groff ../build-aux/man-lint.sh . find.1
check_manpages_format_without_error_messages ( find.1): OK
check_manpages_with_groff_checkstyle_2 ( find.1): FAILED
an.tmac:./find.1:23: style: use of deprecated macro: .HP
make[3]: *** [Makefile:3112: findutils-check-manpages] Error 1
and
env GROFF=groff ../build-aux/man-lint.sh . locate.1 updatedb.1 locatedb.5
check_manpages_format_without_error_messages ( locate.1): OK
check_manpages_format_without_error_messages ( updatedb.1): OK
check_manpages_format_without_error_messages ( locatedb.5): OK
check_manpages_with_groff_checkstyle_2 ( locate.1): FAILED
an.tmac:./locate.1:18: style: use of deprecated macro: .HP
make[3]: *** [Makefile:3287: findutils-check-manpages] Error 1
make[3]: Target 'check-local' not remade because of errors.
The HP hanging paragraph would work nicely, but is marked as deprecated
in groff-1.23; the deprecations warning will disappear in groff-1.24.
Until then, use .TP instead to avoid the check errors.
* find/find.1: Change '.HP' to the '.TP' tagged paragraph macro.
Add a FIXME for 2027 to switch to .HP when groff-1.24 is more commonly
available.
* locate/locate.1: Likewise.
These instances represent hyphen-minus characters, so should be spelled
in man(7) source as `\-`.
* locate/locatedb.5: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
The `\(en` special character escape sequence is not universally
portable. Indirect it through a string definition.
* find/find.1:
* locate/locate.1:
* locate/locatedb.5:
* locate/updatedb.1:
* xargs/xargs.1: Do the above.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* locate/locate.1 (HISTORY):
- Use paragraphing macro to put vertical space above the table so that
it looks more like a typographical "display".[1]
- Set table cells that overset the line on AT&T nroff (where the line
length is 65n) using text blocks.
- Issue `na` request in these text blocks to prevent the cell contents
from adjusting in the event the formatter/package/user has configured
man pages to employ adjustment by default. (Practices vary; it's a
long story.[2])
- Remove spaces around the configured tbl(1) tab character of `|`. This
certainly does make the table uglier in source form. Unfortunately,
AT&T tbl(1) takes those spaces deadly seriously and they impact the
computed cell (and therefore column) widths. GNU tbl has for decades
supported a "nospaces" region option to address precisely this
problem; unfortunately it is not portable to DWB 3.3, Plan 9, or
Solaris 10 troffs, and I suspect not to _any_ surviving System V
troff.
Fixes warning from tbl(1) in groff 1.23.0:
locate/locate.1:289: warning: table wider than line length minus indentation
[1] man(7) implementations are historically inconsistent with respect to
whether a `TS` macro call should put any vertical space on the
output, and compositional practices on the part of man page authors
have thus been, to quote Ingo Schwarze, "wildly inconsistent".
https://savannah.gnu.org/bugs/?62841
[2] "Some people do hate adjustment of nroff output, though, which is
why I added a feature to groff man(7) to support disabling it.
The history of this practice is inconsistent. Seventh Edition Unix
(1979) disabled adjustment of man pages when rendering in nroff
mode,[3] and BSD retained that disablement until death. SunOS
commented it as early as SunOS 2.0 (1985), thus restoring adjustment
in nroff mode, and retained that all the way through Solaris 10
(2005). When James Clark wrote groff starting in about 1989, his
man(7) implementation closely emulated SunOS. With the Solaris 11
release in 2010, Oracle discarded its AT&T-descended troff in favor
of the then-current groff release. [That's not quite true--see
below.] They're still on groff 1.22.2 (2013) today, and so they've
been adjusting their man pages in nroff mode for at least 40 years,
as has groff for about 35[]. I don't know what other System V
Unices did."
https://lists.gnu.org/archive/html/groff/2025-05/msg00001.html
(I made an incorrect claim in the foregoing; Solaris 11 still has
its AT&T troff around, but its man page rendering is now performed
by [an old version of] groff.)
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Use unbreakable spaces between options and their
arguments, potentially improving legibility.
The existing synopses are short enough that they don't break in such a
way as to promote confusion even on old-fashioned AT&T troffs that use a
line length of 65n in nroff mode (vs. groff man(7)'s historical 78n and
present-day 80n). Thus this change merely makes the synopses robust to
future changes.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Use `HP` hanging paragraph macro to indent
non-initial lines of synopsis. Temporarily disable adjustment.
An alternative approach would be to use groff man(7)'s `SY` and `YS`
extension macros; each man page would then need to define local versions
for portability to DWB 3.3, Plan 9, and Solaris 10 troffs.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1: Place thin space escape sequences between ellipsis
dots for more pleasant output when typesetting.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* locate/locate.1:
* locate/updatedb.1:
* xargs/xargs.1: Favor man(7) font alternation macros over *roff font
escape sequences. When typesetting with groff(1), the macros
automatically apply italic corrections.
* locate/locate.1: Protect long option name literals from hyphenation.
GNU troff, Heirloom Doctools troff, and mandoc all support use of the
`\%` hyphenation control escape sequence at the _beginning_ of a word
suppress its hyphenation. Other troffs do not. Indirect this
application of the escape sequence through a string, interpolating
nothing on formatters that don't advertise GNU compatibility via the
`.g` register. (This means that literals can hyphenate undesirably on
DWB, Solaris, and Plan 9 troffs.)
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
* find/find.1:
* xargs/xargs.1: Replace blank lines with empty requests or paragraphing
macro calls as seems to be intended.
* find/find.1: Delete blank lines preceding paragraphing or sectioning
macros that serve only to put excess vertical space in the output.
* locate/locatedb.5: Replace blank lines with a dummy character
producing a blank output line as _might_ be intended.
groff_man_style(7):
? The empty request (.), which does nothing, vertically spaces the
input file for readability by the document maintainer. Do not
put blank (empty) lines in a man page source document. Some
man(1) programs ?squeeze? multiple blank output lines into one.
Fixes style warnings from `groff -rCHECKSTYLE=3 -man`:
an.tmac:/.../share/man/man1/find.1:87: style: blank line in input
...
an.tmac:/.../share/man/man1/xargs.1:231: style: blank line in input
...
an.tmac:/.../share/man/man5/locatedb.5:118: style: blank line in input
...
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Style warnings from `groff -rCHECKSTYLE=3 -man`.
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing third argument; \
consider document modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:/.../share/man/man1/locate.1:1: style: .TH missing fourth argument; \
consider package/project name and version (e.g., "groff 1.23.0")
...and similar.
groff_man_style(7):
.TH identifier section [footer‐middle [footer‐inside [header‐
middle]]]
...
By convention, footer‐middle is the date of the most recent
modification to the man page source document, and footer‐
inside is the name and version or release of the project
providing it.
* find/find.1:
* locate/locate.1:
* locate/locatedb.5:
* locate/updatedb.1:
* xargs/xargs.1: Add appropriate third and fourth arguments to `TH` macro calls.
To determine the revision date to include in the page, I used the Git
"AuthorDate" of the last commit consituting anything but a "bump" to the
copyright notice.
Discussed at:
https://lists.gnu.org/r/bug-findutils/2025-11/msg00094.html
Copyright-paperwork-exempt: Yes
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
From a suggestion by G. Branden Robinson to use `groff -t -z -ww
-rCHECKSTYLE=2 -man`, by pointing to and example in
https://lists.gnu.org/archive/html/bug-findutils/2025-11/msg00004.html.
* configure.ac: discover the location of the groff binary.
* build-aux/man-lint.sh: also run groff with -rCHECKSTYLE=2. Use
groff at the path discovered during configuration.
* find/Makefile.am: Lint-check manpages during "make check",
not "make dist". Set the environment variable GROFF to the
location of the groff binary.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* bootstrap.conf (gnulib_modules): Add nullptr.
In code, prefer nullptr to NULL where either will do.
* cfg.mk (sc_prohibit_NULL): Direct to use nullptr instead.
(begword, endword): Add regex helper macros.
Use standard input instead of stdin, standard output instead of stdout,
and standard error instead of stderr in messages and documentation.
Inspired by coreutils commit:
https://cgit.git.sv.gnu.org/cgit/coreutils.git/commit/?id=c9a30d6781
* cfg.mk (sc_standard_outputs): Add syntax-check rule.
* doc/find.texi: Do the above.
* find/find.1: Likewise.
* locate/locate.1: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.1: Likewise.
* xargs/xargs.c: Likewise.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
Like in the recent commit, also change the following variables to follow
the renaming done in gnulib:
- LIB_SETLOCALE_NULL -> SETLOCALE_NULL_LIB,
- LIB_MBRTOWC -> MBRTOWC_LIB,
- LIB_EACCESS -> EUIDACCESS_LIBGEN.
* find/Makefile.am (LDADD): Change as described above.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
* locate/Makefile.am (LDADD): Remove $(LIB_CLOSE) as it is no longer
required per Gnulib NEWS 2009-03-20.
* xargs/Makefile.am (LADD): Likewise.
* find/Makefile.am (LDADD): Likewise. Change $(LIB_EACCESS) to
$(EUIDACCESS_LIBGEN) per Gnulib NEWS 2023-01-07.
Now that <endian.h> is a part of POSIX 2024 it should become more
portable than <byteswap.h>.
* bootstrap.conf (gnulib_modules): Remove byteswap; add endian.
* locate/word_io.c: Include endian.h instead of byteswap.h.
(decode_value): Use htobe32 instead of bswap_32.
The following syntax-check rule fails:
$ make syntax-check
...
maint.mk: Use #include <hdr.h>, not #include "hdr.h" for the above
make: *** [maint.mk:619: sc_prefer_angle_bracket_headers] Error 1
The rule suggests using '#include <header.h>' instead of
'#include "header.h"' for headers that override system headers.
See gnulib documentation, section "Style of #include statements".
* find/parser.c (#include "fnmatch.h": Change from "..." to <...> style.
* find/pred.c (#include "fnmatch.h"): Likewise.
* find/tree.c (#include "fnmatch.h"): Likewise.
* lib/system.h (#include "error.h"): Likewise.
* locate/locate.c (#include "fnmatch.h"): Likewise.
* tests/xargs/test-sigusr.c (#include "error.h"): Likewise.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
Now that Gnulib's 'error' module does proper static checking
for not returning, we need no longer use the 'die' macro.
This makes code easier to read for people that are used to 'error'.
* cfg.mk (sc_die_EXIT_FAILURE): Remove.
* src/die.h: Remove. All includes removed. All calls to 'die'
changed back to calls to 'error'.
* lib/Makefile.am (libfind_a_SOURCES): Remove 'die.h'.
* src/system.h: Include error.h. Stop including error.h elsewhere.
* find/ftsfind.c (process_all_startpoints): Avoid extra '\n' in error
diagnostics wrt/ -files0-from. Also avoid redundant "%s" formats.
* find/parser.c (parse_perm, parse_regex):
* lib/buildcmd.c (bc_push_arg):
Wrap calls to 'error' in block when under an if-condition and either
the if-condition or the 'error' invocation is spanning over more
than one line.
* find/tree.c (get_pred_cost): Make error message translatable - found
by sc_unmarked_diagnostics.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
https://sparse.docs.kernel.org/
Running the tool against unviled the following warnings:
find/parser.c:328:7: warning: Using plain integer as NULL pointer
find/parser.c:328:10: warning: Using plain integer as NULL pointer
find/parser.c:328:13: warning: Using plain integer as NULL pointer
find/parser.c:466:49: warning: Using plain integer as NULL pointer
find/parser.c:656:45: warning: Using plain integer as NULL pointer
find/print.c:1024:30: warning: Using plain integer as NULL pointer
lib/regexprops.c:531:7: warning: symbol 'options' shadows an earlier one
lib/regextype.c:48:24: warning: symbol 'regex_map' was not declared. Should it be static?
locate/locate.c:131:25: warning: symbol 'check_existence' was not declared. Should it be static?
locate/locate.c:207:12: warning: symbol 'metacharacters' was not declared. Should it be static?
xargs/xargs.c:902:24: warning: symbol 'state' shadows an earlier one
xargs/xargs.c:542:23: warning: Using plain integer as NULL pointer
The fixes for these findings are all trivial, so let's apply them.
* find/parser.c (parse_table): Initialize pointer-type members of
the last element with NULL instead of 0.
(get_noop): Compare to NULL as end condition of for-loop.
(find_parser): Likewise.
* find/print.c (do_fprintf): Initialize linkname with NULL instead of 0.
* lib/regexprops.c (describe_all): Rename local variable options
to regopts to avoid name shadowing.
* lib/regextype.c (regex_map): Declare static.
* locate/locate.c (check_existence): Likewise.
(metacharacters): Likewise.
* xargs/xargs.c (main): Set eof_str to NULL instead of 0.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
The format of the copyright year number range in Texinfo files is
"YEAR1--YEAR2" now, i.e., with 2x '-'.
* tests/sample-test: Adjust to use the single most recent year.
* All other files: Update copyright years via the above make run.
s3fs is a popular way to access S3-compatible object storage.
Its users have reported many bugs being surprised that updatedb crawls
these remote storage systems which causes poor performance:
https://github.com/s3fs-fuse/s3fs-fuse/issues?q=is%3Aissue+updatedb
* locate/updatedb.sh (PRUNEFS): Add 'fuse.s3fs'.
Copyright-paperwork-exempt: Yes
Linking on AIX7.2 fails:
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
Bruno Haible noticed that $(LIB_MBRTOWC) and $(LIB_SETLOCALE_NULL)
expand to -lpthread on that platform, so let's add them to LDADD.
Maybe we should better depend on a 'gnulib.mk' file generated by
'gnulib-import' in the long run, but let's fix this issue with the
simpler solution for now.
* find/Makefile.am (LDADD): Add $(LIB_SETLOCALE_NULL) and $(LIB_MBRTOWC).
* locate/Makefile.am (LDADD): Likewise.
* xargs/Makefile.am (LDADD): Likewise.
* lib/Makefile.am (regexprops_LDADD): Add definition.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
The format of the copyright year number range in Texinfo files is
"YEAR1--YEAR2" now, i.e., with 2x '-'.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
The "BUGS" section also documented how to report bugs. This is better
done in a separate "REPORTING BUGS" section. Add this section where
missing. In it, redirect the user to the "How to get help" section
("#get-help") of the GNU findutils online page; also mention where
to report translation issues.
Bring the sections "SEE ALSO" and "COPYRIGHT" into the correct order,
which is: "REPORTING BUGS", "COPYRIGHT" and finally "SEE ALSO".
See 'man-pages(7)'.
The "SEE ALSO" section now refers to both the corresponding node in
the online HTML version of the Texinfo manual and lists the 'info' command.
Sort the entries referring to other man pages: first by their manual
section numbers, then alphabetically.
While at it, add an empty line (directive '.') before all '.SH' section
headers.
* find/find.1: Do the above.
* locate/locate.1: Likewise.
* locate/locatedb.5: Likewise.
* locate/updatedb.1: Likewise.
* xargs/xargs.1: Likewise.
See section "Handling closed standard file descriptors" in the gnulib
manual.
* bootstrip.conf (gnulib_modules): Add fcntl-safer, openat-safer
and unistd-safer.
* find/exec.c: Include "fcntl--.h" to use the *-safer variant of open()
or openat().
* find/pred.c: Likewise.
* locate/locate.c: Likewise.
* xargs/xargs.c: Likewise, and include "unustd--.h" to use the *-safer
variant of pipe().
Output is from: test-groff -b -mandoc -T utf8 -rF0 -t -w w -z
[ "test-groff" is a developmental version of "groff" ]
Input file is ././find/find.1
<./find/find.1>:365 (macro BR): only 1 argument, but more are expected
<./find/find.1>:380 (macro BR): only 1 argument, but more are expected
<./find/find.1>:1494 (macro BR): only 1 argument, but more are expected
<./find/find.1>:1496 (macro BR): only 1 argument, but more are expected
<./find/find.1>:1513 (macro BR): only 1 argument, but more are expected
[...]
Input file is ././locate/locate.1
troff: <./locate/locate.1>:167: warning: trailing space
* find/find.1: Use a one-font (single letter) macro for a single argument.
* locate/locate.1: Remove a trailing space in a "string".
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* tests/sample-test: Likewise, here to avoid starting a year number range.
* All other files: Update copyright years via the above make run.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
sed(1) on FreeBSD-11.1 and OpenBSD 6.2 requires the last command inside
'{...}' groups to be terminated with a semicolon, otherwise it fails with:
sed: 1: "/^# Copyright /{s/^..// ...: extra characters at the end \
of q command
* locate/Makefile.am (updatedb): Add a ';' after the last command in the
'{...}' group - introduced in commit v4.6.0-133-g6d186665.
Some make implementations, e.g. on NetBSD 7.1, lack it; therefore
avoid it in order to prevent error messages during 'make clean'.
* Makefile.am (coverage-clean): Replace $(RM) by 'rm -f'.
* find/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* locate/Makefile.am: Likewise.
* xargs/Makefile.am: Likewise.
Run 'make update-copyright'.
* lib/regexprops.c (copying): Update the year number manually.
* All other files: Update copyright years via the above make run.
* lib/regextype.c (regex_map): Permute the entries to list POSIX
dialects before other ones, so that we don't end up with a
dangling reference to `ed' regular expressions when
context=findutils. Remove trailing white space from the output.
* doc/regexprops.texi: Regenerate this file, so that we no longer
have a dangling reference to the `ed' dialect.
* doc/find.texi (Regular Expressions): Point out the difference
between Emacs regular expressions and findutils regular
expressions: in findutils "." will match newline.
* find/find.1: Likewise.
* locate/locate.1: Likewise. Also document the --regextype option.