Bug 297248 - groff: .Fx needs the right release version
Summary: groff: .Fx needs the right release version
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexander Ziaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-03 17:02 UTC by Wolfram Schneider
Modified: 2026-08-07 14:58 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schneider freebsd_committer freebsd_triage 2026-08-03 17:02:41 UTC
Some of our manual pages use the .Fx macro. The macro expect a correct FreeBSD release, or no argument

from the mdoc(7) manpage:
     Fx [version]
          Format the FreeBSD version provided as an argument, or a default
          value if no argument is provided.

          Examples:
                .Fx 7.1
                .Fx

groff complains if the FreeBSD version is not correct, or ends with a dot.

zcat /usr/share/man/man1/elfctl.1.gz | nroff -mdoc >/dev/null 
doc.tmac:<standard input>:123: warning: .Fx: Unknown FreeBSD version 'Foundation.' (#123)

zcat /usr/share/man/man3/stdbit.3.gz | nroff -mdoc >/dev/null 
doc.tmac:<standard input>:118: warning: .Fx: Unknown FreeBSD version '15.1.' (#118)


How to repeat:
find -s /usr/share/man -name '*.gz' | xargs -P$(nproc) -n16 zegrep  '^\.Fx .*[^ ]\.$|^\.Fx [a-z]'

/usr/share/man/man1/elfctl.1.gz:.Fx Foundation.
/usr/share/man/man1/ipcrm.1.gz:.Fx 6.4 No and 7.1.
/usr/share/man/man1/strings.1.gz:.Fx v3.
/usr/share/man/man1/strings.1.gz:.Fx v5 ,
/usr/share/man/man2/lio_listio.2.gz:.Fx extensions, and should not be used in portable code.
/usr/share/man/man3/stdbit.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_bit_ceil.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_bit_floor.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_bit_width.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_count_ones.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_count_zeros.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_first_leading_one.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_first_leading_zero.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_first_trailing_one.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_first_trailing_zero.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_has_single_bit.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_leading_ones.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_leading_zeros.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_trailing_ones.3.gz:.Fx 15.1.
/usr/share/man/man3/stdc_trailing_zeros.3.gz:.Fx 15.1.
/usr/share/man/man4/bridge.4.gz:.Fx 16.0.
/usr/share/man/man4/bxe.4.gz:.Fx imposes a limit on the maximum number of
/usr/share/man/man4/if_bridge.4.gz:.Fx 16.0.
/usr/share/man/man4/if_bxe.4.gz:.Fx imposes a limit on the maximum number of
/usr/share/man/man4/if_sume.4.gz:.Fx version and this manual page were written by
/usr/share/man/man4/inet.4.gz:.Fx implementation sets it to zero.
/usr/share/man/man4/sume.4.gz:.Fx version and this manual page were written by
/usr/share/man/man5/pf.conf.5.gz:.Fx pf uses
/usr/share/man/man5/pf.conf.5.gz:.Fx pf .
/usr/share/man/man8/route.8.gz:.Fx provides support for scalable multipath routing.
/usr/share/man/man3/memalignment.3.gz:.Fx 15.1.


The solution is simple - add a space before the trailing dot:
.Fx 15.1. -> 
.Fx 15.1 .

or add a newline after .Fx if no argument is required:

.Fx Foundation. -> 
.Fx
Foundation.
Comment 1 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-03 21:38:30 UTC
I'll fix these.

> or add a newline after .Fx if no argument is required:
>
> .Fx Foundation. -> 
> .Fx
> Foundation.

Please do not do this. The *x macros are for denoting operating systems. This is semantically different because the FreeBSD Foundation is a copyright holder, so the appropriate macro is .An.

The application is that then we can search manuals for ones the FreeBSD Foundation has funded work in, like every other copyright holder. The correct usage is like this:

.Fx Foundation. ->
.An FreeBSD Foundation .

Thanks for reporting this.
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-08-04 00:36:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ff2bc641599a7845f597ad02ccfc98c5467fa948

commit ff2bc641599a7845f597ad02ccfc98c5467fa948
Author:     Alexander Ziaee <ziaee@FreeBSD.org>
AuthorDate: 2026-08-03 23:31:25 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2026-08-04 00:32:36 +0000

    manuals: Fix Fx and nearby mechanical typos

    Fix compiler warnings related to the Fx macro, as well as all other
    mechanical typos that were visible within one screenful of them. These
    cause rendering glitches on various toolchains with various of the five
    and a half decades of rich output formats and tooling manpages scale to.

    The *x macro set specifies operating systems. These macros take the rest
    of the line as an argument. Sometimes, a space was not used to separate
    the argument of Fx and the trailing period. Another, FreeBSD Foundation
    was misrepresented as an operating system version instead of an author.
    Two more had other parts of the sentence supplied as an argument to Fx.

    While I had those open, fix the other mechancial typos visible on those
    specific screenfulls. Fix a list width glitch, correct section typo
    AUTHOR to AUTHORS, and switch AUTHORS sections containing prose to
    prose-mode so that they wrap freely when rendered.

    PR:             297248
    MFC after:      3 days
    Fixes:          d39e310c7d6a ("man/man3: add stdbit.3")
    Fixes:          d790b16bbf0c ("add man pages for stdbit functions")
    Fixes:          b61850c4e6f6 ("net.link.bridge.member_ifaddrs to false")
    Reported by:    wosch (groff is complaining about incorrect Fx usage)

 contrib/elftoolchain/strings/strings.1     | 2 +-
 lib/libc/stdbit/stdc_bit_ceil.3            | 4 ++--
 lib/libc/stdbit/stdc_bit_floor.3           | 4 ++--
 lib/libc/stdbit/stdc_bit_width.3           | 4 ++--
 lib/libc/stdbit/stdc_count_ones.3          | 4 ++--
 lib/libc/stdbit/stdc_count_zeros.3         | 4 ++--
 lib/libc/stdbit/stdc_first_leading_one.3   | 4 ++--
 lib/libc/stdbit/stdc_first_leading_zero.3  | 2 +-
 lib/libc/stdbit/stdc_first_trailing_one.3  | 4 ++--
 lib/libc/stdbit/stdc_first_trailing_zero.3 | 4 ++--
 lib/libc/stdbit/stdc_has_single_bit.3      | 4 ++--
 lib/libc/stdbit/stdc_leading_ones.3        | 4 ++--
 lib/libc/stdbit/stdc_leading_zeros.3       | 4 ++--
 lib/libc/stdbit/stdc_trailing_ones.3       | 4 ++--
 lib/libc/stdbit/stdc_trailing_zeros.3      | 4 ++--
 lib/libsys/lio_listio.2                    | 3 ++-
 share/man/man3/stdbit.3                    | 4 ++--
 share/man/man4/bridge.4                    | 2 +-
 share/man/man4/bxe.4                       | 3 ++-
 share/man/man4/inet.4                      | 3 ++-
 share/man/man4/sume.4                      | 3 ++-
 usr.bin/elfctl/elfctl.1                    | 5 +++--
 usr.bin/ipcrm/ipcrm.1                      | 9 ++++++---
 23 files changed, 48 insertions(+), 40 deletions(-)
Comment 3 Wolfram Schneider freebsd_committer freebsd_triage 2026-08-04 13:48:15 UTC
Thanks for taking the issue. Are you sure we got all the manpages? Running grep on the source tree I see:

$ git grep -E '^\.Fx .*[^ ]\.$|^\.Fx [a-uw-z]'

lib/libc/stdbit/stdc_first_leading_zero.3:.Fx 15.1.
lib/libc/stdlib/memalignment.3:.Fx 15.1.
sbin/route/route.8:.Fx provides support for scalable multipath routing.
share/man/man5/pf.conf.5:.Fx pf uses
share/man/man5/pf.conf.5:.Fx pf .
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-08-04 14:16:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=82c013fb59114b228cbc59536914be1c1772c69c

commit 82c013fb59114b228cbc59536914be1c1772c69c
Author:     Alexander Ziaee <ziaee@FreeBSD.org>
AuthorDate: 2026-08-04 14:04:23 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2026-08-04 14:04:23 +0000

    manuals: Fix more Fx and nearby mechanical typos

    Fix compiler warnings related to the Fx macro, as well as all other
    mechanical typos that were visible within one screenful of them. These
    cause rendering glitches on various toolchains with various of the five
    and a half decades of rich output formats and tooling manpages scale to.

    The *x macro set specifies operating systems. These macros take the rest
    of the line as an argument. Sometimes, a space was not used to separate
    the argument of Fx and the trailing period. Others had other parts of
    the sentence supplied as an argument to Fx.

    While here, fix the other mechanical typos visible on those specific
    screenfulls. Correct section typo AUTHOR to AUTHORS, markup utilities
    with Sy, and apply line break after the end of a sentence.

    PR:             297248
    MFC after:      3 days
    Reported by:    wosch (are you sure that's all of the broken Fx'es?)
    Fixes:          ff2bc641599a ("Fix Fx and nearby mechanical typos")
    Fixes:          d790b16bbf0c ("add man pages for stdbit functions")
    Fixes:          6c57e368eb17 ("implement C23 memalignment()")
    Fixes:          b06338167d64 ("ROUTE_MPATH and FIB_ALGO")
    Fixes:          7e1affa242ca ("revise divert-to and divert-reply")

 lib/libc/stdbit/stdc_first_leading_zero.3 |  2 +-
 lib/libc/stdlib/memalignment.3            |  4 ++--
 sbin/route/route.8                        |  3 ++-
 share/man/man5/pf.conf.5                  | 16 +++++++++++-----
 4 files changed, 16 insertions(+), 9 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-08-07 14:58:50 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e8f4f422fea2cfc1a7b524b69be7ee090bdac06

commit 6e8f4f422fea2cfc1a7b524b69be7ee090bdac06
Author:     Alexander Ziaee <ziaee@FreeBSD.org>
AuthorDate: 2026-08-03 23:31:25 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2026-08-07 14:58:15 +0000

    manuals: Fix Fx and nearby mechanical typos

    Fix compiler warnings related to the Fx macro, as well as all other
    mechanical typos that were visible within one screenful of them. These
    cause rendering glitches on various toolchains with various of the five
    and a half decades of rich output formats and tooling manpages scale to.

    The *x macro set specifies operating systems. These macros take the rest
    of the line as an argument. Sometimes, a space was not used to separate
    the argument of Fx and the trailing period. Another, FreeBSD Foundation
    was misrepresented as an operating system version instead of an author.
    Two more had other parts of the sentence supplied as an argument to Fx.

    While I had those open, fix the other mechancial typos visible on those
    specific screenfulls. Fix a list width glitch, correct section typo
    AUTHOR to AUTHORS, and switch AUTHORS sections containing prose to
    prose-mode so that they wrap freely when rendered.

    PR:             297248
    MFC after:      3 days
    Fixes:          d39e310c7d6a ("man/man3: add stdbit.3")
    Fixes:          d790b16bbf0c ("add man pages for stdbit functions")
    Fixes:          b61850c4e6f6 ("net.link.bridge.member_ifaddrs to false")
    Reported by:    wosch (groff is complaining about incorrect Fx usage)

    (cherry picked from commit ff2bc641599a7845f597ad02ccfc98c5467fa948)

 contrib/elftoolchain/strings/strings.1     | 2 +-
 lib/libc/stdbit/stdc_bit_ceil.3            | 4 ++--
 lib/libc/stdbit/stdc_bit_floor.3           | 4 ++--
 lib/libc/stdbit/stdc_bit_width.3           | 4 ++--
 lib/libc/stdbit/stdc_count_ones.3          | 4 ++--
 lib/libc/stdbit/stdc_count_zeros.3         | 4 ++--
 lib/libc/stdbit/stdc_first_leading_one.3   | 4 ++--
 lib/libc/stdbit/stdc_first_leading_zero.3  | 2 +-
 lib/libc/stdbit/stdc_first_trailing_one.3  | 4 ++--
 lib/libc/stdbit/stdc_first_trailing_zero.3 | 4 ++--
 lib/libc/stdbit/stdc_has_single_bit.3      | 4 ++--
 lib/libc/stdbit/stdc_leading_ones.3        | 4 ++--
 lib/libc/stdbit/stdc_leading_zeros.3       | 4 ++--
 lib/libc/stdbit/stdc_trailing_ones.3       | 4 ++--
 lib/libc/stdbit/stdc_trailing_zeros.3      | 4 ++--
 lib/libsys/lio_listio.2                    | 3 ++-
 share/man/man3/stdbit.3                    | 4 ++--
 share/man/man4/bridge.4                    | 2 +-
 share/man/man4/bxe.4                       | 3 ++-
 share/man/man4/inet.4                      | 3 ++-
 share/man/man4/sume.4                      | 3 ++-
 usr.bin/elfctl/elfctl.1                    | 5 +++--
 usr.bin/ipcrm/ipcrm.1                      | 9 ++++++---
 23 files changed, 48 insertions(+), 40 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-08-07 14:58:51 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8ce50d778757766d237d31e2d7fcea611fd3e204

commit 8ce50d778757766d237d31e2d7fcea611fd3e204
Author:     Alexander Ziaee <ziaee@FreeBSD.org>
AuthorDate: 2026-08-04 14:04:23 +0000
Commit:     Alexander Ziaee <ziaee@FreeBSD.org>
CommitDate: 2026-08-07 14:58:19 +0000

    manuals: Fix more Fx and nearby mechanical typos

    Fix compiler warnings related to the Fx macro, as well as all other
    mechanical typos that were visible within one screenful of them. These
    cause rendering glitches on various toolchains with various of the five
    and a half decades of rich output formats and tooling manpages scale to.

    The *x macro set specifies operating systems. These macros take the rest
    of the line as an argument. Sometimes, a space was not used to separate
    the argument of Fx and the trailing period. Others had other parts of
    the sentence supplied as an argument to Fx.

    While here, fix the other mechanical typos visible on those specific
    screenfulls. Correct section typo AUTHOR to AUTHORS, markup utilities
    with Sy, and apply line break after the end of a sentence.

    PR:             297248
    MFC after:      3 days
    Reported by:    wosch (are you sure that's all of the broken Fx'es?)
    Fixes:          ff2bc641599a ("Fix Fx and nearby mechanical typos")
    Fixes:          d790b16bbf0c ("add man pages for stdbit functions")
    Fixes:          6c57e368eb17 ("implement C23 memalignment()")
    Fixes:          b06338167d64 ("ROUTE_MPATH and FIB_ALGO")
    Fixes:          7e1affa242ca ("revise divert-to and divert-reply")

    (cherry picked from commit 82c013fb59114b228cbc59536914be1c1772c69c)

 lib/libc/stdbit/stdc_first_leading_zero.3 |  2 +-
 lib/libc/stdlib/memalignment.3            |  4 ++--
 sbin/route/route.8                        |  3 ++-
 share/man/man5/pf.conf.5                  | 16 +++++++++++-----
 4 files changed, 16 insertions(+), 9 deletions(-)