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 1vQxqH-00369L-16 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 01:09:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQxqF-00HNcZ-0w for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Dec 2025 01:09:07 +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 1vQxqE-00HNcR-2z for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 01:09:07 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQxqC-0031Lm-1r for pgsql-hackers@lists.postgresql.org; Thu, 04 Dec 2025 01:09:06 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-8823fa3bd95so13584066d6.1 for ; Wed, 03 Dec 2025 17:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764810544; x=1765415344; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vIQLqdrfnmLDAQq6Z/LF9gVJTXmccKUw41WE6b7xc8o=; b=BfD5wmoYgWUbJ+6KbdQ5uak0ZzqbKj8QGQYpxAa6DmzZFt9Enghv7OHAyKs2l+YWrm /VNUHszh18hJKYdQ6NFKeF6EjVPT77KD7PaGsZd8uShb2tx7lhWAwpF12hEQAgVGcHmc V8EaG2tCx1jJ7H5n+T8RzvI79h+SnoMjSRW3ee7nKztM1KAi1za5o05xUFG/0c6FK9zi sNc2KOYEwzZbplQ6vx7K9aBp0AE5ie2P8OunRdZFYbZAk5y55EWOkcfivP/iGgbviKNe D8La+BQugSUyBjO7lG66tEzl4l0fc/axyFZ6i8M7b2pB7eiGUjAj5dlZpGawq+EuQC5k uukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764810544; x=1765415344; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vIQLqdrfnmLDAQq6Z/LF9gVJTXmccKUw41WE6b7xc8o=; b=lGrsrnCur4qctp5QSFOYFS7ubHFf8a5XYN0qyT7ob8laOmgD7v8emCyXHtvWUXiOyb +VOA66/00H8nx2KDzFcfOVajgAwplQEpUZ/1KQZf0YcIkOk1pQ1+taeN2OI4zoO8JyF9 qNe9FijSrhXbRP+oSBFC9wxgN0zrvW5Dhb5dcVQ10rbaoDDbFBBNHfy0d26+ikjLVtZY I1IVD5LM/9RJL64FuKMoNeDa6MSMQ6ZUFePKcUBIPMVDTRf2xTFPknGJpS7NXLA9vFwY Q6JVnrd/U5NEQrCg0UmjVZrUUl+SbAu09eelL8DPtlUInDGnxWFKSDhwu6Fyqb27qudL 39HQ== X-Forwarded-Encrypted: i=1; AJvYcCX4XuQ73ccbmpbY4Lf+xc5h/LkRhTVMKxRNWrQHd8Bk+6mrTKxiZODQl4ld1X0ywnFhOM0GYTclU01f+19V@lists.postgresql.org X-Gm-Message-State: AOJu0YzJ2uQXaOvkAVgLbLl0Z3CW+BgvZb3H9DC9PWtJFJoy8Scp+hVw S0xjEnG082ie46t6Rd32GFDdfBEKmaddpn9pGJqfS4BtmrfOchPruiq+Os98xu7/9WUYjl4EruP zhDnROcV9N4wNwuDuYPBOpWsPaCIRQaU= X-Gm-Gg: ASbGncuZgL1rhswrE6kIl/rR1t2IJcUu5jcUJAl2yEE9hE6OVLA47Bdc1fgRtqSgBgU 3Q8HcUoW3rHw90DFVXdCZKypP/xI1pvk2hMoDXsS2+wVyDCyrIuPLdHDHpzO6FLyZdJSTeAHzGy nF/7kbshzC9CU+ZwFdzrvV0ODN4pnazSwnGfxg3R9KgwTrOK1/+BWZ1Y2pJ0zupH5rv5hj9mAgm NBOqo/Fv8CMf4TVEQg/A0D2NsktcPHBrPVdARUGVTHScygY9mY/8lzVi5eOQe04qGiFojrr476v B0Okk9Bhmjp39RZ0lWCnWhS4+C+myQ== X-Google-Smtp-Source: AGHT+IEA8loHZj7nrn/r3yZXrNXy+LJlt08iQujVJKiAXmHJ65+8E+DraSWXKOpnqXviQRpEn3KY7B2fIqG+aPv99FI= X-Received: by 2002:a05:6214:2f0a:b0:880:4c2b:1c31 with SMTP id 6a1803df08f44-888245d3061mr28705046d6.32.1764810544457; Wed, 03 Dec 2025 17:09:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Thu, 4 Dec 2025 12:08:37 +1100 X-Gm-Features: AWmQ_bnnBAak9BIQPlhQHow8Ii5iDdpbLZLQVRl599f1PFNNue6P_8_dkrde2tA Message-ID: Subject: Re: Cleanup shadows variable warnings, round 1 To: Chao Li Cc: Peter Eisentraut , Postgres hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk FWIW... A few more review comments for v3. ////////// Patch v3-0001. ////////// ====== src/backend/access/gist/gistbuild.c 2.1. OK, but should you take it 1 step further? BEFORE foreach(lc, splitinfo) { GISTPageSplitInfo *si = lfirst(lc); AFTER foreach_ptr(GISTPageSplitInfo, si, splitinfo) { ====== src/backend/commands/schemacmds.c 2.2. OK, but should you take it 1 step further? BEFORE foreach(parsetree_item, parsetree_list) { Node *substmt = (Node *) lfirst(parsetree_item); AFTER foreach_ptr(Node, substmt, parsetree_list) { ====== src/backend/commands/statscmds.c 2.3. OK, but I felt 'attnums_bms' might be a better replacement name than 'attnumsbm' ====== src/backend/executor/nodeValuesscan.c 2.4. OK, but should you take it 1 step further? BEFORE foreach(lc, exprstatelist) { ExprState *exprstate = (ExprState *) lfirst(lc); AFTER foreach_ptr(ExprState, exprstate, exprstatelist) { ====== src/backend/statistics/dependencies.c 2.5. The other variable in other parts of this function had names like: clause_expr bool_expr or_expr stat_expr So, perhaps your new names should be changed slightly to look more similar to those? ====== src/backend/statistics/extended_stats.c 2.6. This seems to be in the wrong patch because here you renamed the local var, not the inner one, as the patch commit message says. ====== src/backend/utils/adt/jsonpath_exec.c 2.7. Wondering if 'vals' might be a better name than 'foundJV' (there is already another JsonValueList vals elsewhere in this code). ====== src/bin/pgbench/pgbench.c 2.8. Wondering if 'nskipped' is a better name than 'skips'. ////////// Patch v3-0003 ////////// LGTM. ====== Kind Regards, Peter Smith. Fujitsu Australia