Commit f01592f
committed
Remove shadowed local variables that are new in v15
Compiling with -Wshadow=compatible-local yields quite a few warnings about
local variables being shadowed by compatible local variables in an inner
scope. Of course, this is perfectly valid in C, but we have had bugs in
the past as a result of developers failing to notice this. af7d270 is a
recent example.
Here we do a cleanup of warnings we receive from -Wshadow=compatible-local
for code which is new to PostgreSQL 15. We've yet to have the discussion
about if we actually ever want to run that as a standard compilation flag.
We'll need to at least get the number of warnings down to something easier
to manage before we can realistically consider if we want this or not.
This commit is the first step towards reducing the warnings.
The changes being made here are all fairly trivial. Because of that, and
the fact that v15 is still in beta, this is being back-patched into 15.
It seems more risky not to do this as the risk of future bugs is increased
by the additional conflicts that this commit could cause for any future
bug fixes touching the same areas as this commit.
Author: Justin Pryzby
Discussion: https://postgr.es/m/20220817145434.GC26426%40telsasoft.com
Backpatch-through: 151 parent 3097bde commit f01592f
File tree
5 files changed
+39
-46
lines changed- src
- backend
- backup
- parser
- replication/logical
- utils/adt
- bin/pg_dump
5 files changed
+39
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
710 | | - | |
711 | 710 | | |
712 | 711 | | |
713 | 712 | | |
| |||
759 | 758 | | |
760 | 759 | | |
761 | 760 | | |
762 | | - | |
| 761 | + | |
763 | 762 | | |
764 | 763 | | |
765 | | - | |
766 | | - | |
767 | 764 | | |
768 | 765 | | |
769 | 766 | | |
770 | | - | |
| 767 | + | |
771 | 768 | | |
772 | 769 | | |
773 | | - | |
774 | 770 | | |
775 | 771 | | |
776 | 772 | | |
| |||
819 | 815 | | |
820 | 816 | | |
821 | 817 | | |
822 | | - | |
823 | | - | |
| 818 | + | |
| 819 | + | |
824 | 820 | | |
825 | | - | |
| 821 | + | |
826 | 822 | | |
827 | 823 | | |
828 | 824 | | |
| |||
838 | 834 | | |
839 | 835 | | |
840 | 836 | | |
841 | | - | |
| 837 | + | |
842 | 838 | | |
843 | | - | |
| 839 | + | |
844 | 840 | | |
845 | 841 | | |
846 | 842 | | |
| |||
950 | 946 | | |
951 | 947 | | |
952 | 948 | | |
953 | | - | |
954 | 949 | | |
955 | 950 | | |
956 | 951 | | |
957 | 952 | | |
958 | | - | |
959 | | - | |
960 | | - | |
| 953 | + | |
961 | 954 | | |
962 | 955 | | |
963 | 956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3109 | 3109 | | |
3110 | 3110 | | |
3111 | 3111 | | |
3112 | | - | |
| 3112 | + | |
3113 | 3113 | | |
3114 | | - | |
3115 | | - | |
| 3114 | + | |
| 3115 | + | |
3116 | 3116 | | |
3117 | 3117 | | |
3118 | 3118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3142 | 3142 | | |
3143 | 3143 | | |
3144 | 3144 | | |
3145 | | - | |
3146 | | - | |
3147 | | - | |
3148 | | - | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
3149 | 3149 | | |
3150 | 3150 | | |
3151 | 3151 | | |
| |||
3163 | 3163 | | |
3164 | 3164 | | |
3165 | 3165 | | |
3166 | | - | |
3167 | | - | |
3168 | | - | |
3169 | | - | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
3170 | 3170 | | |
3171 | 3171 | | |
3172 | 3172 | | |
| |||
3178 | 3178 | | |
3179 | 3179 | | |
3180 | 3180 | | |
3181 | | - | |
3182 | | - | |
3183 | | - | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
3184 | 3184 | | |
3185 | | - | |
3186 | | - | |
| 3185 | + | |
| 3186 | + | |
3187 | 3187 | | |
3188 | 3188 | | |
3189 | 3189 | | |
| |||
7081 | 7081 | | |
7082 | 7082 | | |
7083 | 7083 | | |
7084 | | - | |
| 7084 | + | |
7085 | 7085 | | |
7086 | 7086 | | |
7087 | 7087 | | |
7088 | 7088 | | |
7089 | 7089 | | |
7090 | | - | |
7091 | | - | |
7092 | | - | |
| 7090 | + | |
| 7091 | + | |
| 7092 | + | |
7093 | 7093 | | |
7094 | 7094 | | |
7095 | 7095 | | |
7096 | 7096 | | |
7097 | 7097 | | |
7098 | | - | |
| 7098 | + | |
7099 | 7099 | | |
7100 | 7100 | | |
7101 | 7101 | | |
| |||
16800 | 16800 | | |
16801 | 16801 | | |
16802 | 16802 | | |
16803 | | - | |
| 16803 | + | |
16804 | 16804 | | |
16805 | 16805 | | |
16806 | 16806 | | |
| |||
0 commit comments