From nobody Sat Sep 30 18:31:26 2023 X-Original-To: dev-commits-src-main@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 4RybQR00SCz4vgZg; Sat, 30 Sep 2023 18:31:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RybQQ6bkdz4fkT; Sat, 30 Sep 2023 18:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696098686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzKxeCB9LNSXj4+Ber+w70hNN6p9GjQTUL295xS3I7c=; b=Jh9CPm4raSwjEabFuZSTNLpFgQpt5aaYlNvfgxmCaxCnqN+B0Nq+Cc6pOTPhBNhRbOQHtp 3NFmfpHtsQVR1skCtUSRXqv0Cavp0i6VitgF6C8RVQcG+UmeQvZVeur4fEjujh6af5vp5M qfuPV+LQzzzHvHPSzNwG7TznyMNjWExoiLrUE5lmNf/p7nXohywSHUTEZLt05fFWYXuxVy xnFCSiU6N58j7NH67kgwGPthPBxmpeGToQORwJfZAGUu1R6avH/oGzpmA64fdx6z36q4hu yvbFz//I5J6qoTTc9BQdYYvU78AdSqW+AlkqD13njMtgGzUAPkmbFSygMPBL0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696098686; a=rsa-sha256; cv=none; b=WtuykOX1AEk1La75VUSRM9ErWuGnl7ggGLIiI1m4vh58BhpvZGZzZQQGeHkshUhsP5clpj sIL0GJ4ntAx29m3qG+ZQEmkj1/P4w0BUUm336DG/RtlyNVtxkG+gRG2iivCTLblQVesJvK fkunJ+8Aphr9vyiJgXpe4Woh7bp20c6f4IWXqWVDm3PnV0fZrtM6ergjHpXlFqBcxWFrDy 7KzADgcbBmrEdkIv09cLw/K++8u0vvgYU7mV6igczPp6mVt8cHQX+RhbYH8gSYzI0KzqZL irUftpg66AM9ffZwIDojdrNOgifcQ5GuBSEB8VXK0TL1wA+PVX+ZSC1DhUesTA== 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=1696098686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GzKxeCB9LNSXj4+Ber+w70hNN6p9GjQTUL295xS3I7c=; b=kcKLQ9VyzWazlO+uFg0NSbRqxX1dLOuMzjCblROvEmgc+FcZUPEE3tAqFLNPBi/0/w6ILs lWTSb0+9vnVwglPenyS7ejQWwD3augVyUK5bHi4e1rxPIIj6ckpzvY+rDVpBkSqfAxcAkH ssUbC33eQPZUiAnVtmFvEkVOFe32p8ZXMiq88QLpvM5iuQYsqwmSMxWuWJhdJMCZrKaazS Z8YfgRdrnur8n9OsjgdxHRMabwkKYElb8ktnff6mD1Vb1t3nve03IaPqqMYYyoxhgJvMuY Dp93edl7oUnaxVDLgFT3g5BNX749BN2q3Vjj15JEp60FrCY6DmfpkW9W8zh8SQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RybQQ5M7kzy5D; Sat, 30 Sep 2023 18:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38UIVQu1007242; Sat, 30 Sep 2023 18:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38UIVQrc007239; Sat, 30 Sep 2023 18:31:26 GMT (envelope-from git) Date: Sat, 30 Sep 2023 18:31:26 GMT Message-Id: <202309301831.38UIVQrc007239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 8a77bc5e1be1 - main - makefs/zfs: fix build with gcc 12 after b5a2bf512dbe List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a77bc5e1be1a999f2f8d9df0c01fe01fb5a0787 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8a77bc5e1be1a999f2f8d9df0c01fe01fb5a0787 commit 8a77bc5e1be1a999f2f8d9df0c01fe01fb5a0787 Author: Dimitry Andric AuthorDate: 2023-09-30 18:27:20 +0000 Commit: Dimitry Andric CommitDate: 2023-09-30 18:27:20 +0000 makefs/zfs: fix build with gcc 12 after b5a2bf512dbe Due to integer promotion rules, dn_nlevels (uint8_t) gets promoted to a plain int, resulting in -Werror warnings with gcc 12: In file included from /workspace/src/usr.sbin/makefs/zfs.c:35: /workspace/src/usr.sbin/makefs/zfs.c: In function '_dnode_cursor_flush': /workspace/src/usr.sbin/makefs/zfs.c:684:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 684 | assert(levels <= c->dnode->dn_nlevels - 1); | ^~ /workspace/src/usr.sbin/makefs/zfs.c:691:27: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 691 | if (level == c->dnode->dn_nlevels - 1) { | ^~ /workspace/src/usr.sbin/makefs/zfs.c: In function 'dnode_cursor_next': /workspace/src/usr.sbin/makefs/zfs.c:739:41: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 739 | for (levels = 0; levels < c->dnode->dn_nlevels - 1; levels++) { | ^ Fix it by subtracting 1U instead of 1. Fixes: b5a2bf512dbe MFC after: 3 days --- usr.sbin/makefs/zfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/zfs.c b/usr.sbin/makefs/zfs.c index db302fe1e760..b16a48564f04 100644 --- a/usr.sbin/makefs/zfs.c +++ b/usr.sbin/makefs/zfs.c @@ -681,14 +681,14 @@ _dnode_cursor_flush(zfs_opt_t *zfs, struct dnode_cursor *c, unsigned int levels) off_t blkid, blksz, loc; assert(levels > 0); - assert(levels <= c->dnode->dn_nlevels - 1); + assert(levels <= c->dnode->dn_nlevels - 1U); blksz = MAXBLOCKSIZE; blkid = (c->dataoff / c->datablksz) / BLKPTR_PER_INDIR; for (unsigned int level = 1; level <= levels; level++) { buf = c->inddir[level - 1]; - if (level == c->dnode->dn_nlevels - 1) { + if (level == c->dnode->dn_nlevels - 1U) { pbp = &c->dnode->dn_blkptr[0]; } else { uint64_t iblkid; @@ -736,7 +736,7 @@ dnode_cursor_next(zfs_opt_t *zfs, struct dnode_cursor *c, off_t off) /* Do we need to flush any full indirect blocks? */ if (off > 0) { blkid = off / c->datablksz; - for (levels = 0; levels < c->dnode->dn_nlevels - 1; levels++) { + for (levels = 0; levels < c->dnode->dn_nlevels - 1U; levels++) { if (blkid % BLKPTR_PER_INDIR != 0) break; blkid /= BLKPTR_PER_INDIR;