From nobody Fri Feb 6 01:07:29 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f6bXy1KFSz6RTs6 for ; Fri, 06 Feb 2026 01:07:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f6bXx6YMHz3CY4 for ; Fri, 06 Feb 2026 01:07:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770340050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rk9P2YkOApKV/mAqd7Zted2iGGIFU5uBAJYmVDJNFrY=; b=W1iioQa3Cry9VP2y048qbVV3ohMeeiHq2rd1wgutOk4YeSthhfomnJ/mWLnuWm9gbtH3h2 1U4eSuYJJ09Jk7ve4BdhZlsvNz7zM/K43Dma0/oSVwR2sj1zztP2KO9Yqy1/3WPdT1KVq5 lqRZSb96p9ynmxj88ACA1pGmnqTPkkEIw/XHX852b0mUcU63JE7cwT104GAjf8qKnYKuW0 N91ZRydJKND9rULYQD2QquqMstlwqJTfa6t+vBXwdBm+EM0I6zW/77SUjVQXdY5gAU3i9Y 0UQtQUL67Sj8lRFkiuFdFTSazaILiv/lcXTF7wSxImUMKQt816WmZK0Tju3ayg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770340050; a=rsa-sha256; cv=none; b=v1xndTd06u1IesEKpFHVlhVfW/WSmOAGwTUy3CdYSj2YR8qUakJcsk2HQ7WJKJDiIqeB65 W0EllnZNWQm78IwqbNS1P9ZV78Criv80pagQBP8CI5zk4BIGnQPKmfdLqGulG5dev/fSEF NvXGDNLqPIwt1/jGqHRWbOY6/agCzY6lcMlcjZfL8wdqdfuGgijCWrRkyNiTLPNqhVk/2H vSgXjHlLmrDR642G9zc1NMdbkuIyC7uWd2NfAM03aTw06sWuvFwO/4aKfdBIJ59Tq2BkNU 4rIVxbAOu6WxbwDRc+0k3nhnAn3tUOWgqIA5hl7UZf0fJozhIwoy529FFuJJXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770340050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rk9P2YkOApKV/mAqd7Zted2iGGIFU5uBAJYmVDJNFrY=; b=WaCbcc00b/fxH1mVMM/SQ6IeVaRv+FmSCGEvvLEZqVq5WKsNzCjHHTUNgci55erJxsvmeV bzo1csJFnWvHSyvGt6t7tnmoRcmE3jUcXf+qh8QFkgg+k7aFXgG75Go0ks0bOqEXAgLuvP u6RvA6YT3v7PQ1k8tQ3W1LkvG0VHFijoBmBWBcXH/bK97oWs6InmpI1jNJu3/jCv1YK5Vq ixy0N/whwcN+fzkcdEGo3SNirMpFy9jLqlrUD/yH/wQTr6jV9W1SXAloQLi32pK3NJAFVe V+k+yLAIV5Wo5P6PCuuYn8P1vRJM9ze0pPEk1DSa/uwn60IsrYKgUXkufAKJOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f6bXx64nsztnD for ; Fri, 06 Feb 2026 01:07:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36315 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 06 Feb 2026 01:07:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ingo Schwarze From: Colin Percival Subject: git: e261ea91050c - releng/14.4 - mandoc: Improve width calculation for GCC compat List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.4 X-Git-Reftype: branch X-Git-Commit: e261ea91050c6955a00d3428c3a3522971789aa1 Auto-Submitted: auto-generated Date: Fri, 06 Feb 2026 01:07:29 +0000 Message-Id: <69853ed1.36315.512962e7@gitrepo.freebsd.org> The branch releng/14.4 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e261ea91050c6955a00d3428c3a3522971789aa1 commit e261ea91050c6955a00d3428c3a3522971789aa1 Author: Ingo Schwarze AuthorDate: 2025-08-25 22:58:48 +0000 Commit: Colin Percival CommitDate: 2026-02-06 01:06:59 +0000 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. Approved by: re (cperciva) 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 (cherry picked from commit 93bc3d83a11a1dbebd264616d63af3dd32cc1c8c) (cherry picked from commit 0d066d21668172aa7fc9bc38f9a0725ae31f0deb) --- contrib/mandoc/roff_term.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/mandoc/roff_term.c b/contrib/mandoc/roff_term.c index 8f95aa920790..85d2caeb2749 100644 --- a/contrib/mandoc/roff_term.c +++ b/contrib/mandoc/roff_term.c @@ -165,6 +165,7 @@ roff_term_pre_po(ROFF_TERM_ARGS) static int polast; /* Previously requested. */ static int po; /* Currently requested. */ static int pouse; /* Currently used. */ + int pomin; /* Minimum to be used. */ int pomax; /* Maximum to be used. */ int ponew; /* Newly requested. */ @@ -186,9 +187,9 @@ roff_term_pre_po(ROFF_TERM_ARGS) po = ponew; /* Truncate to the range [-offset, 60], remember, and apply it. */ + pomin = -p->tcol->offset; pomax = term_len(p, 60); - pouse = po >= pomax ? pomax : - po < -(int)p->tcol->offset ? -p->tcol->offset : po; + pouse = po > pomax ? pomax : po < pomin ? pomin : po; p->tcol->offset += pouse; }