HomeFreeBSD

mandoc: Improve width calculation for GCC compat

Description

mandoc: Improve width calculation for GCC compat

Avoid implicitly converting a potentially negative page offset
to size_t and then back to int. While this was not a bug and the end
result was portably correct, Alexander Ziaee@ privately reported to me
that the GCC 14 in the FreeBSD Jenkins CI felt uneasy about it.

For clarity and readability, rewrite the truncation statement
to not mix signed and unsigned types, to not use explicit casts,
and make handling of the lower and upper cutoff more similar
to each other.

Fixes: 6410c1b51637 (mandoc: vendor import of upstream at 2025-07-27)
MFC after: 3 days
Reported by: ivy
Reviewed by: ivy
Differential Revision: https://reviews.freebsd.org/D52127

Details

Provenance
Ingo Schwarze <schwarze@usta.de>Authored on Aug 25 2025, 10:58 PM
ziaeeCommitted on Aug 25 2025, 11:02 PM
Reviewer
ivy
Differential Revision
D52127: mandoc: Improve width calculation for GCC compat
Parents
rGa4d738d78305: amdgpio: Mask and service interrupts
Branches
Unknown
Tags
Unknown