postgresql/src
David Rowley 421892a192 Further reduce warnings with -Wshadow=compatible-local
In a similar effort to f01592f91, here we're targetting fixing the
warnings that -Wshadow=compatible-local produces that we can fix by moving
a variable to an inner scope to stop that variable from being shadowed by
another variable declared somewhere later in the function.

All of the warnings being fixed here are changing the scope of variables
which are being used as an iterator for a "for" loop.  In each instance,
the fix happens to be changing the for loop to use the C99 type
initialization.  Much of this code likely pre-dates our use of C99.

Reducing the scope of the outer scoped variable seems like the safest way
to fix these.  Renaming seems more likely to risk patches using the wrong
variable.  Reducing the scope is more likely to result in a compilation
failure after applying some future patch rather than introducing bugs with
it.

By my count, this takes the warning count from 129 down to 114.

Author: Justin Pryzby
Discussion: https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com
2022-08-24 12:27:12 +12:00
..
backend Further reduce warnings with -Wshadow=compatible-local 2022-08-24 12:27:12 +12:00
bin Further reduce warnings with -Wshadow=compatible-local 2022-08-24 12:27:12 +12:00
common Don't bother to set sockaddr_un.sun_len. 2022-08-24 00:09:37 +12:00
fe_utils Remove configure probe for sys/select.h. 2022-08-14 00:09:47 +12:00
include Remove our artificial PG_SOMAXCONN limit on listen queue length. 2022-08-23 10:15:06 -04:00
interfaces Further reduce warnings with -Wshadow=compatible-local 2022-08-24 12:27:12 +12:00
makefiles solaris: Remove unnecessary gcc / gnu ld vs sun studio differences 2022-08-07 09:36:01 -07:00
pl Add PGDLLEXPORTS to some plpgsql function declarations 2022-07-20 10:24:50 +02:00
port Remove replacement code for getaddrinfo. 2022-08-14 09:53:28 +12:00
template aix: Remove checks for very old OS versions 2022-08-07 09:36:01 -07:00
test Make role grant system more consistent with other privileges. 2022-08-22 11:35:17 -04:00
timezone Remove fallbacks for strtoll, strtoull. 2022-08-06 09:59:51 +12:00
tools Don't define FRONTEND for libpq 2022-08-22 20:39:30 -07:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Remove unused configure variable. 2022-08-18 11:22:13 -04:00
Makefile.shlib solaris: Remove unnecessary gcc / gnu ld vs sun studio differences 2022-08-07 09:36:01 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00