From nobody Fri Feb 6 00:31:52 2026 X-Original-To: dev-commits-src-branches@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 4f6Zlr6wqzz6RSQ4 for ; Fri, 06 Feb 2026 00:31:52 +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 4f6Zlr3t0Yz43sm for ; Fri, 06 Feb 2026 00:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770337912; 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=N7PjQgEvnLcrsTdRVYJ5k5xOyCfdPCT/Ph2E4oJSYxo=; b=CxBlpnw7/i7KWtnVvHTuwOELVNL6nU0JG/+hepqNU6NtRjcDu1UVFD97vIo2t2EofYztTK DL2W41SpSIdoQbEfUJisKugoLb7KOSdySYJDEd4PPy/GgiYf+Sax7EGihN/AQcuwyRmrss WUlDD+XnVw7B+JbCMqBstC4A9XPZZF82vq7HI2buDNrw6t7d0h0CGufPulU3zR9/6FQ2Oz IF+q87at7LJ2/0ZRSB6She9TebxCDdmVWBY8zKg5IjYq8esIyWGG/of2ufkZ6sODbthcCp 68BpKhzvZeENBpiXuxHihDZIG4y7Pyf9sSZhdYE3U2fjnEJTIdkgFKQgmGSsqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770337912; a=rsa-sha256; cv=none; b=skJgbjftxVZ7x2K2Wr5ymD3eGdTifLGQ7u380hEdNvfVLkePa7KLw6Z/eZnm0jFGdnNQl1 lDMrfBOe8GqxLL/mAd5LIItSbIVKvo5mjg/3D7nyY7r8BA8mPTaD3aGg6Jlo6X4SVplItf nj5e6jGad+fjVEEVCjzUg4utq0DubI/vn6eE+FCqHbJD3tiIvsD27dz69Vrt5EkKrPPAJO 7HBUCmqBBs20BckDL2UNYYn05sPq63eMguuJ/gMKm3j0MBjL9YAqb+81xwGoCB5Vd7Otov Ek2U1A/RDdAfezm2m+APHkmNRwEEJhDgvVBk4K2F2mhDMaUtY2InAEjTM1rSOg== 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=1770337912; 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=N7PjQgEvnLcrsTdRVYJ5k5xOyCfdPCT/Ph2E4oJSYxo=; b=EP8al7cl/n1jLwAm/fALwiug4hQKuli8coJTytxNQxVdF9OyPJPdgLav23rUUNJ2WCi3/n mF2qjHmccNoXtaMFwIvhJFkC+hYskjhNvKq6DxbsnG+K94SBjY1sz59lhOhCZbLN9kW/u/ DsVN/nc5RfgXTHbPw5eGF6+stQSp1S31jPZbdZwWYasRbjYVVKAPDDNvBasLTR6tdz8VkC Mi9Iq7ioGwC3BEWy8+gbbHQ1EiNJnTJvfVz2qWVPqpwDevNGogpTxJBIGAbKeemmylYYa8 mJAeIOQMF9RjE8Li6McuIzofxUCxqaKIlTfk/636biV/wU5IY0sZbwm6K32WwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f6Zlr3GPJzt8X for ; Fri, 06 Feb 2026 00:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 320ba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 06 Feb 2026 00:31:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ingo Schwarze From: Alexander Ziaee Subject: git: 0d066d216681 - stable/14 - mandoc: Improve width calculation for GCC compat List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d066d21668172aa7fc9bc38f9a0725ae31f0deb Auto-Submitted: auto-generated Date: Fri, 06 Feb 2026 00:31:52 +0000 Message-Id: <69853678.320ba.3018fe2d@gitrepo.freebsd.org> The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0d066d21668172aa7fc9bc38f9a0725ae31f0deb commit 0d066d21668172aa7fc9bc38f9a0725ae31f0deb Author: Ingo Schwarze AuthorDate: 2025-08-25 22:58:48 +0000 Commit: Alexander Ziaee CommitDate: 2026-02-06 00:31:06 +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. 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) --- 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; }