Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQgjU-00EvQY-0A for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 06:53:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQgjR-00BvlO-1c for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Dec 2025 06:52:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQgjR-00BvlE-0g for pgsql-hackers@lists.postgresql.org; Wed, 03 Dec 2025 06:52:57 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQgjO-002stV-1O for pgsql-hackers@lists.postgresql.org; Wed, 03 Dec 2025 06:52:56 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7ba92341f83so9351507b3a.0 for ; Tue, 02 Dec 2025 22:52:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764744774; x=1765349574; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1ikjQgm32YETfLf5L6HGekmVDOiPcx+2aEEXLzBHaFM=; b=mxQhmYQ4OS5tH1H39sIVtvi81f/on/ff3r2Yv4p5zrwqerVlS+IUR0VO5epdZ1QHEC DzeG7HKORjCe/HKB3BCCfRQcCKYRLEqSAl8a+SphlAVxBvEhEwnIVdAJ5vMKyu/k1bHp q8kVj5tIK7qGks54AOijufpxgToEqB9opsTGjkcsszBpqN/ytAJA/LIypvDeLcITfrbU gnwcN6eb7QYRpaOu3xgv0AmOiPvWebcR4X1PZA/bFPfVaDzyYu8+AFzAh6izpdqztXzW qxdzmxiqqigSkJlrkum+rp1p6GE+LZhdD6AT628Lg3Kklu4JtPgXQoC0nnDYLecS3J6A KBAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764744774; x=1765349574; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1ikjQgm32YETfLf5L6HGekmVDOiPcx+2aEEXLzBHaFM=; b=n3Vd6QOsCxmEPB/IqzC3GyJthmx1p0POKTgydResX71WM68srlwiIT3cEW7fMwqDH8 fBpqSVsHlc+ZapbMJ+SO/LSYoF93Ya6jNAQyBf67TJ5FixMpBFvHrok3oej2HSJkOdpw m3/wDi6rd0XXDIuOtFomIKD1HU7Ox3ATMzFvHgHyhiJGLcpUKIl1BYRRA1iSsQoYuZKC /Vcp2edjGa6U7RKz0jEZiLZld4pHtpF+HCeWS/fdmC1IMPZ8V0NC99sG9zTEaPOzPu2M TRTRsgJOCBa2R02+Uz3RbMBFCFecV3nyE+8lv5WqM5BwjOynewn/HKzakDu4FNiiZ+3J rpXg== X-Forwarded-Encrypted: i=1; AJvYcCWfSlBd9p07fUUOZAOQAcuKy52bl2xzAMECXxZZcv5hqDTpmolT1bUWU9eBHHqHKKzWct92HzBqTE9NoQ5A@lists.postgresql.org X-Gm-Message-State: AOJu0Yz1e7fmdr/Hoge6g21MByLtLbskXsVyODV0BP+ZjKeJnmLn3In4 pIA1h+JmgPNTjpckTvG5UpTEOPaJkTjSeO1WUVEyVGJy2VQVhtSblos0 X-Gm-Gg: ASbGncvn9WSghuov7b/wspSkgbRSxBRbwIhmoudw1ZPVnbss2QNPvwtAaY7CNHytS3T T+drP0nZuNiUqBTQxAXRn5DeOQjem3iPOlCha2EOeJviTI2Y0Zk9NvWtDHFuMephu/FFCaE3faE TsTudHvsSc4Nt3PM5JhpQuvF7lVL2lHM5og0eXFsl2wgofYpqbRxKzsV6tsSSkSi3uUivwOLSux 1KcQxg0eqnPXT140/YoB+1zLr/McrkmJjtnEGHvRa5ogLyjrIf5LIv60siAgmWDxg+9okTJECpA 0RgbAf3QFt4FG1Oz7nXlj8Y3GAZu1Px1DJ7LrL0bhcm2rmOTdgUg1aoQNMR6kvbshPP89zrX118 plk+YOKc/3rHru7sr19VfLZgSw6JqcYoYr6Rix4easNANnNrcNEhiDmtkXRnnOO2Z6jEBmiOB6p DKA2JEuCIzyLE9zc2A1EU= X-Google-Smtp-Source: AGHT+IGdQSys+xw0E3/DB+uBy51oc3b5p/K/4eb7TX42vcU1QN7aojAg5fQdiYevFa2H4Ipa7ypyfw== X-Received: by 2002:a05:6a00:1894:b0:7a2:8853:28f6 with SMTP id d2e1a72fcca58-7e00e3b6793mr1394402b3a.22.1764744774047; Tue, 02 Dec 2025 22:52:54 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7d1516f6609sm18945701b3a.15.2025.12.02.22.52.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Dec 2025 22:52:53 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: Cleanup shadows variable warnings, round 1 From: Chao Li In-Reply-To: Date: Wed, 3 Dec 2025 14:52:14 +0800 Cc: Peter Eisentraut , Postgres hackers Content-Transfer-Encoding: quoted-printable Message-Id: <94ECEF6E-681B-40DF-8F6B-4CABE4CDB96A@gmail.com> References: To: Peter Smith X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 3, 2025, at 14:42, Peter Smith wrote: >=20 > Patch v2-0001. >=20 > src/backend/backup/basebackup_incremental.c: > PrepareForIncrementalBackup: >=20 > Instead of changing the var name from 'i' to 'u', you can fix this one > by changing all the for loops to declare 'i' within the 'for ('. > That way kills two birds with one stone: it removes the shadow warning > and at the same time improves the scope of the loop variables. >=20 >=20 > - int i; >=20 > - for (i =3D 0; i < num_wal_ranges; ++i) > + for (int i =3D 0; i < num_wal_ranges; ++i) >=20 > - for (i =3D 0; i < num_wal_ranges; ++i) > + for (int i =3D 0; i < num_wal_ranges; ++i) >=20 > - unsigned i; >=20 > - for (i =3D 0; i < nblocks; ++i) > + for (unsigned i =3D 0; i < nblocks; ++i) Unfortunately that doesn=E2=80=99t work for my compiler (clang on = MacOS), that=E2=80=99s why I renamed =E2=80=9CI" to =E2=80=9Cu=E2=80=9D. By the way, Peter (S), thank you very much for reviewing. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/