Commit 112f022
committed
Add optional parameter to PG_TRY() macros
This optional parameter can be specified in cases where there are nested
PG_TRY() statements within a function in order to stop the compiler from
issuing warnings about shadowed local variables when compiling with
-Wshadow. The optional parameter is used as a suffix on the variable
names declared within the PG_TRY(), PG_CATCH(), PG_FINALLY() and
PG_END_TRY() macros. The parameter, if specified, must be the same in
each component macro of the given PG_TRY() block.
This also adjusts the single case where we have nested PG_TRY() statements
to add a parameter to the inner-most PG_TRY().
This reduces the number of compiler warnings when compiling with
-Wshadow=compatible-local from 5 down to 1.
Author: David Rowley
Discussion: https://postgr.es/m/CAApHDvqWGMdB_pATeUqE=JCtNqNxObPOJ00jFEa2_sZ20j_Wvg@mail.gmail.com1 parent 23f3989 commit 112f022
2 files changed
+29
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | | - | |
| 1681 | + | |
1682 | 1682 | | |
1683 | 1683 | | |
1684 | 1684 | | |
1685 | 1685 | | |
1686 | | - | |
| 1686 | + | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | | - | |
| 1690 | + | |
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
313 | 321 | | |
314 | 322 | | |
315 | | - | |
| 323 | + | |
316 | 324 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
322 | 330 | | |
323 | | - | |
| 331 | + | |
324 | 332 | | |
325 | | - | |
| 333 | + | |
326 | 334 | | |
327 | 335 | | |
328 | 336 | | |
329 | | - | |
330 | | - | |
| 337 | + | |
| 338 | + | |
331 | 339 | | |
332 | | - | |
| 340 | + | |
333 | 341 | | |
334 | 342 | | |
335 | | - | |
| 343 | + | |
336 | 344 | | |
337 | | - | |
338 | | - | |
| 345 | + | |
| 346 | + | |
339 | 347 | | |
340 | | - | |
| 348 | + | |
341 | 349 | | |
342 | | - | |
| 350 | + | |
343 | 351 | | |
344 | | - | |
345 | | - | |
| 352 | + | |
| 353 | + | |
346 | 354 | | |
347 | 355 | | |
348 | 356 | | |
| |||
0 commit comments