forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit421892a
committed
Further reduce warnings with -Wshadow=compatible-local
In a similar effort tof01592f, here we're targetting fixing thewarnings that -Wshadow=compatible-local produces that we can fix by movinga variable to an inner scope to stop that variable from being shadowed byanother variable declared somewhere later in the function.All of the warnings being fixed here are changing the scope of variableswhich 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 typeinitialization. Much of this code likely pre-dates our use of C99.Reducing the scope of the outer scoped variable seems like the safest wayto fix these. Renaming seems more likely to risk patches using the wrongvariable. Reducing the scope is more likely to result in a compilationfailure after applying some future patch rather than introducing bugs withit.By my count, this takes the warning count from 129 down to 114.Author: Justin PryzbyDiscussion:https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com1 parent869e56a commit421892a
File tree
11 files changed
+22
-32
lines changed- src
- backend
- access
- brin
- gist
- commands
- executor
- optimizer/path
- statistics
- storage/buffer
- bin/pg_dump
- interfaces/ecpg/pgtypeslib
11 files changed
+22
-32
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
372 | 372 |
| |
373 | 373 |
| |
374 | 374 |
| |
375 |
| - | |
376 | 375 |
| |
377 | 376 |
| |
378 | 377 |
| |
| |||
454 | 453 |
| |
455 | 454 |
| |
456 | 455 |
| |
457 |
| - | |
| 456 | + | |
458 | 457 |
| |
459 | 458 |
| |
460 | 459 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
582 | 582 |
| |
583 | 583 |
| |
584 | 584 |
| |
585 |
| - | |
586 | 585 |
| |
587 | 586 |
| |
588 | 587 |
| |
| |||
662 | 661 |
| |
663 | 662 |
| |
664 | 663 |
| |
665 |
| - | |
| 664 | + | |
666 | 665 |
| |
667 | 666 |
| |
668 | 667 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
234 | 234 |
| |
235 | 235 |
| |
236 | 236 |
| |
237 |
| - | |
238 | 237 |
| |
239 | 238 |
| |
240 | 239 |
| |
| |||
420 | 419 |
| |
421 | 420 |
| |
422 | 421 |
| |
423 |
| - | |
| 422 | + | |
424 | 423 |
| |
425 | 424 |
| |
426 | 425 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 | 1204 |
| |
1205 |
| - | |
1206 | 1205 |
| |
1207 | 1206 |
| |
1208 | 1207 |
| |
| |||
1401 | 1400 |
| |
1402 | 1401 |
| |
1403 | 1402 |
| |
1404 |
| - | |
| 1403 | + | |
1405 | 1404 |
| |
1406 | 1405 |
| |
1407 | 1406 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
565 | 565 |
| |
566 | 566 |
| |
567 | 567 |
| |
568 |
| - | |
569 | 568 |
| |
570 | 569 |
| |
571 | 570 |
| |
| |||
1047 | 1046 |
| |
1048 | 1047 |
| |
1049 | 1048 |
| |
1050 |
| - | |
| 1049 | + | |
1051 | 1050 |
| |
1052 | 1051 |
| |
1053 | 1052 |
| |
| |||
1067 | 1066 |
| |
1068 | 1067 |
| |
1069 | 1068 |
| |
1070 |
| - | |
| 1069 | + | |
1071 | 1070 |
| |
1072 | 1071 |
| |
1073 | 1072 |
| |
| |||
1243 | 1242 |
| |
1244 | 1243 |
| |
1245 | 1244 |
| |
1246 |
| - | |
| 1245 | + | |
1247 | 1246 |
| |
1248 | 1247 |
| |
1249 | 1248 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1296 | 1296 |
| |
1297 | 1297 |
| |
1298 | 1298 |
| |
1299 |
| - | |
1300 | 1299 |
| |
1301 | 1300 |
| |
1302 | 1301 |
| |
1303 | 1302 |
| |
1304 | 1303 |
| |
1305 |
| - | |
| 1304 | + | |
1306 | 1305 |
| |
1307 | 1306 |
| |
1308 | 1307 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2447 | 2447 |
| |
2448 | 2448 |
| |
2449 | 2449 |
| |
2450 |
| - | |
2451 | 2450 |
| |
2452 | 2451 |
| |
2453 | 2452 |
| |
| |||
2486 | 2485 |
| |
2487 | 2486 |
| |
2488 | 2487 |
| |
2489 |
| - | |
2490 | 2488 |
| |
2491 | 2489 |
| |
2492 | 2490 |
| |
| |||
2495 | 2493 |
| |
2496 | 2494 |
| |
2497 | 2495 |
| |
2498 |
| - | |
| 2496 | + | |
| 2497 | + | |
2499 | 2498 |
| |
2500 | 2499 |
| |
2501 | 2500 |
| |
2502 | 2501 |
| |
2503 | 2502 |
| |
2504 | 2503 |
| |
2505 | 2504 |
| |
2506 |
| - | |
| 2505 | + | |
| 2506 | + | |
2507 | 2507 |
| |
2508 | 2508 |
| |
2509 | 2509 |
| |
|
Lines changed: 5 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1604 | 1604 |
| |
1605 | 1605 |
| |
1606 | 1606 |
| |
1607 |
| - | |
1608 | 1607 |
| |
1609 | 1608 |
| |
1610 | 1609 |
| |
| |||
1659 | 1658 |
| |
1660 | 1659 |
| |
1661 | 1660 |
| |
1662 |
| - | |
| 1661 | + | |
1663 | 1662 |
| |
1664 | 1663 |
| |
1665 | 1664 |
| |
| |||
1766 | 1765 |
| |
1767 | 1766 |
| |
1768 | 1767 |
| |
1769 |
| - | |
| 1768 | + | |
1770 | 1769 |
| |
1771 | 1770 |
| |
1772 | 1771 |
| |
| |||
1837 | 1836 |
| |
1838 | 1837 |
| |
1839 | 1838 |
| |
1840 |
| - | |
| 1839 | + | |
1841 | 1840 |
| |
1842 | 1841 |
| |
1843 | 1842 |
| |
| |||
1930 | 1929 |
| |
1931 | 1930 |
| |
1932 | 1931 |
| |
1933 |
| - | |
| 1932 | + | |
1934 | 1933 |
| |
1935 | 1934 |
| |
1936 | 1935 |
| |
| |||
1956 | 1955 |
| |
1957 | 1956 |
| |
1958 | 1957 |
| |
1959 |
| - | |
| 1958 | + | |
1960 | 1959 |
| |
1961 | 1960 |
| |
1962 | 1961 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3183 | 3183 |
| |
3184 | 3184 |
| |
3185 | 3185 |
| |
3186 |
| - | |
3187 | 3186 |
| |
3188 | 3187 |
| |
3189 | 3188 |
| |
| |||
3232 | 3231 |
| |
3233 | 3232 |
| |
3234 | 3233 |
| |
3235 |
| - | |
| 3234 | + | |
3236 | 3235 |
| |
3237 | 3236 |
| |
3238 | 3237 |
| |
| |||
3259 | 3258 |
| |
3260 | 3259 |
| |
3261 | 3260 |
| |
3262 |
| - | |
| 3261 | + | |
3263 | 3262 |
| |
3264 | 3263 |
| |
3265 | 3264 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11576 | 11576 |
| |
11577 | 11577 |
| |
11578 | 11578 |
| |
11579 |
| - | |
11580 | 11579 |
| |
11581 | 11580 |
| |
11582 | 11581 |
| |
| |||
11853 | 11852 |
| |
11854 | 11853 |
| |
11855 | 11854 |
| |
11856 |
| - | |
| 11855 | + | |
11857 | 11856 |
| |
11858 | 11857 |
| |
11859 | 11858 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1062 | 1062 |
| |
1063 | 1063 |
| |
1064 | 1064 |
| |
1065 |
| - | |
1066 | 1065 |
| |
1067 | 1066 |
| |
1068 | 1067 |
| |
| |||
1109 | 1108 |
| |
1110 | 1109 |
| |
1111 | 1110 |
| |
1112 |
| - | |
| 1111 | + | |
1113 | 1112 |
| |
1114 | 1113 |
| |
1115 | 1114 |
| |
| |||
1268 | 1267 |
| |
1269 | 1268 |
| |
1270 | 1269 |
| |
1271 |
| - | |
| 1270 | + | |
1272 | 1271 |
| |
1273 | 1272 |
| |
1274 | 1273 |
| |
|
0 commit comments
Comments
(0)