Article View: linux.kernel.git
Article #2070[PATCH 0/3] use size_t for a few sizes that are 32 bits everywhere
From: Elia Pinto
Date: Sun, 01 Nov 2026 15:36
Date: Sun, 01 Nov 2026 15:36
36 lines
11897 bytes
11897 bytes
Unlike the previous series, these aren't about "long" on Windows: the
types involved ("uint32_t", "int", "unsigned int") are 32 bits on every
platform. They were found by scanning a native 64-bit Linux build with
-Wshorten-64-to-32. That scan sees the "unsigned long" -> 32-bit
conversions that a Windows target can't see, because there "long" is
already 32 bits.
- 1/3 hashwrite(): a corrupt pack when pack-objects writes a compressed
buffer of 4GiB or more in one call;
- 2/3 count_lines(): a wrong diff -B --stat for files of 2GiB or more;
- 3/3 hash_chars(): renames of files of 4GiB or more aren't recognised.
No tests, because they need GiB-sized inputs; each was verified by
simulating the truncation at 16 bits.
The other results of that scan are bounded by the format or by the input
(options, masks, line lengths, xdiff limited to 1023MiB). It doesn't
depend on the other series in flight and merges cleanly with them. Based
on master 50fe5cc63f.
Elia Pinto (3):
csum-file: use size_t for the count passed to hashwrite()
diff: use size_t for the size passed to count_lines()
diffcore-delta: use size_t for the size of the buffer to hash
csum-file.c | 2 +-
csum-file.h | 2 +-
diff.c | 2 +-
diffcore-delta.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
base-commit: 50fe5cc63f9cd6e89b87a2c9ccf96a444f4cfdb7
--
2.53.0
Technical Details
Message-ID:
<cover.1793546752.git.gitter.spiros@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74068-linux-kernel-git=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74068-linux-kernel-git=dewy.ru
From: gitter.spiros@gmail.com (Elia Pinto)
Newsgroups: linux.kernel.git
Subject: [PATCH 0/3] use size_t for a few sizes that are 32 bits everywhere
Date: Sun, 1 Nov 2026 16:36:48 +0100
Organization: Usenet Network
Message-ID: <cover.1793546752.git.gitter.spiros@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2713017"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:b0OjczC94onhou8yg4mGRTq4dzU= sha256:+AkEVhrV2UFTBMZs/OESZWlgrifLdt4GY9bU+2gy+QM=
sha1:R066MCVfbt6O4cd4bzh234hfxHQ= sha256:u3pC4z8fT7qEZNd/4xWW6E1zFighU75FjUHKlEpeJW8=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 8648FD0948; Sun, 1 Nov 2026 18:37:20 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id CDYUq4-HyfJg;
Sun, 1 Nov 2026 18:37:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-74068-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id B0E7A114004; Sun, 1 Nov 2026 18:37:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id EBDCE21ED5; Sun, 1 Nov 2026 15:36:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793547419;
b=weE5eArghTEhbst9kjirC2rAXyoBDEQBrAX48F53mAHB0Mte5P5xL3pWoOBB729Xg06D
ydI1zEvjRliwU5rkOiguYgMWyhL+G8YgCFYN6Ba+j62kyi47BBFpNtKDqaPTYpVIlvdIl
AXH2EH4V8M7p3IulVRzizq5qDMmOqAaiX9GPQAURAkTd6LdY8xSxpnjITZOdW3qgVAWbu
5OqmQGTC0V3zjkC7bNjkAnTcJ/rqZf0VXtRjcGDxN296AQbvtfRNEBUZ8sjCv8VoNdU3L
lPaeXWlg22iFYMXuz0B5uh5rkd7cFQbT2xbee+m2xcKk0QDFUPfxLddWIiXDsDEgUVA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793547419;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=YMh4c4VkmQ/yYv/XXlB4IurxkSbZBL5yqcukdWFeZHU=;
b=bqcQUr4u+/zYnygHyaC+a+JxAxyMCbX4919/A79rWfGI0K5QTMXLsHJNt1cdkV01UCki
KpJwO0yfLAEGz2oL+dADxS8wieqpsdKaAa0Ec5qFSaaMnV+6rtBgx8Rjw28aBSLje0dnx
hhoWbhXsYMTeWsPzk1FYLYIQ6xE+/3o9xWHUorhaN8bP3fKY1aB75rLzgHmh9toHA0swI
Va6kXMzZCgzpJPCG2b//NSmq/gfC+bCSzp7K8MJkIdRYHXSxs2Dne4ZJUQY1qDG+ZF5JB
AF+RT6gZxRKYUX6wF8fDDMsAK3D+3SiTxYOc3lttd/BWNcc+l1KEyXYrlmEfiG6CiyQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=VT+u4ttp;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id A3E0D606A332;
Sun, 1 Nov 2026 15:36:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=VT+u4ttp
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793547418;
b=1bIggp/vHVIVA/lMtP4pGhxAcpITLB0HsMP+0QpcxKt/volwMJwWuKWgu5WciWeJ+nfa
CRcyB3chK5sv3iu0ZP4f2R/1AOBIFkA/zxYrWU8mjPoqsJqxxidECavn9u1bJPN2XEXI+
LdOw7llp3+QdgD402DS2zE51T0XSokU36RipQfHO+vIQKMXZpHbsmKGgTbrup5jugWi5p
Dn79LH+gwbMpRfPBhlhm0jdd5wKtSiSwR3aLWKqTlFC2fn5s6v/4rMPX6eeu5+N/CDw2c
SAh5xkIajnBjsvtar6qMYPvI3urXoprQdUPiuWbrwEuOcBCwIqtJOnhEFFaXJ0DtWDA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793547418;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
bh=YMh4c4VkmQ/yYv/XXlB4IurxkSbZBL5yqcukdWFeZHU=;
b=A44fLwnKvQskuN9YWQ0DlzKFR052JHy9cPgTEQwQDCO/f4bzJPAiPKMEgJoCqhmfc/Tx
ReO9iwft83u93SlCd3Y/TbZ3+BAsES+iWbLxFVTmPZccL4N22YORWrOjD/le6ZkzDGn5s
BLUNOAI9YWFTVr3F3X0y/nXjbDOiFd1A/dg1ZxMV9IX9UT78cQzOWei8S14ILPn0nCArf
ncqCPiFcoY++rfLn32x1P4nlEQfHv0a6xDmT96Tdi/OLcGw54ivsQXYxAAQJ10xzU6kCy
cmYG4cSFwQyEaW98swxP9KUrkzU8gEwzAXn2LSg2cFoWy5lz0R1BxdKq9t2MRnfv/Og==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=VT+u4ttp;
arc=none smtp.remote-ip=209.85.221.47
X-Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73AD1606A327
for <git@vger.kernel.org>; Sun, 1 Nov 2026 15:36:58 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73AD1606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-48c4d870d54so1251204f8f.2
for <git@vger.kernel.org>; Sun, 01 Nov 2026 07:36:58 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793547417; x=1794152217; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=YMh4c4VkmQ/yYv/XXlB4IurxkSbZBL5yqcukdWFeZHU=;
b=VT+u4ttpIRuZxp+BBBdUBFnB4j+NxXAv77KrquJj3gPA100/HOqZ6K9AkJjJit4aV/
6Dp1FeUMjf2qupb33vMaNM/aYosGm2O+f3Dnmp1VRmRkmRz54JGUuPsQzV6gNeIJVTC8
79Kd2TkRdCrQv4NI5JIlnqNUYaAYYioGcgFR8Cz6fqpLsT15l9mb9s5ka1Gnf2irtvI1
mNigu1BiM8yZKDW4JD71mMgZwMS/tTDSTpzhK83linr93mLNmQX7GWsUZy/r94Pi0UHO
pQM8pun2nRB/DXPe41rLn0hOPnVBj91lxU8+KNQJnIoQ7y8th8CpcdVHa2tg1LK1N3GH
Hs1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793547417; x=1794152217;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=YMh4c4VkmQ/yYv/XXlB4IurxkSbZBL5yqcukdWFeZHU=;
b=lgTYDfITOZ8chDQEHbNd28jh1VFotTPrBwd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3oLKHUH7KW9BoONvWlLVTzv8soXLjZOgsx47rv4b0=
X-Received: by 2002:a05:6000:4b0b:b0:48e:1b11:7ed0 with SMTP id ffacd0b85a97d-48e6e2ff15bmr15563718f8f.33.1793547416626;
Sun, 01 Nov 2026 07:36:56 -0800 (PST)
X-Received: from ubuntu26lts1.example.com ([151.31.213.44])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e71b7246fsm14908450f8f.19.2026.11.01.07.36.54
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 01 Nov 2026 07:36:55 -0800 (PST)
X-Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Elia Pinto <gitter.spiros@gmail.com>,
Patrick Steinhardt <ps@pks.im>,
Neeraj Singh <neerajsi@microsoft.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
Junio C Hamano <gitster@pobox.com>,
Michael Montalbo <mmontalbo@gmail.com>
X-Mailer: git-send-email 2.53.0
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list