pgsql: Disable -Wsometimes-uninitialized warnings in the 9.2 branch.

2021-12-12 Thread Tom Lane
Disable -Wsometimes-uninitialized warnings in the 9.2 branch. In 9.2, we didn't yet teach the compiler that elog(ERROR) doesn't return, which means that the compiler's opinion about whether variable dereferences are reachable isn't worth much. Back-patching the commits that fixed that seems undul

pgsql: Fix function return type confusion

2021-12-12 Thread Tom Lane
Fix function return type confusion When parse_hba_line's return type was changed from bool to a pointer, the MANDATORY_AUTH_ARG macro wasn't adjusted. This back-patches commit c74d586d2 into out-of-support branches, pursuant to newly-established project policy. The point is to suppress scary-loo

pgsql: Fix compiler warning

2021-12-12 Thread Tom Lane
Fix compiler warning With some newer gcc versions (8 and 9) you get a -Wformat-overflow warning here. In PG11 and later this was already fixed. Since it's trivial, backport it to get the older branches building without warnings. This back-patches commit 333a186dc into out-of-support branches, p

pgsql: Fix compiler warning

2021-12-12 Thread Tom Lane
Fix compiler warning With some newer gcc versions (8 and 9) you get a -Wformat-overflow warning here. In PG11 and later this was already fixed. Since it's trivial, backport it to get the older branches building without warnings. This back-patches commit 333a186dc into out-of-support branches, p

pgsql: Silence another gcc 11 warning.

2021-12-12 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-12-12 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Silence another gcc 11 warning.

2021-12-12 Thread Tom Lane
Silence another gcc 11 warning. Per buildfarm and local experimentation, bleeding-edge gcc isn't convinced that the MemSet in reorder_function_arguments() is safe. Shut it up by adding an explicit check that pronargs isn't negative, and by changing MemSet to memset. (It appears that either change

pgsql: Suppress uninitialized-variable warning in guc.c.

2021-12-12 Thread Tom Lane
Suppress uninitialized-variable warning in guc.c. Back-patch 26812bcaa into 9.5, to suppress one more warning in out-of-support branches. (Doesn't appear to be needed before 9.5.) Discussion: https://postgr.es/m/d0316012-ece7-7b7e-2d36-9c38cb77c...@enterprisedb.com Branch -- REL9_5_STABLE

pgsql: Improve description of some WAL records with transaction command

2021-12-12 Thread Michael Paquier
Improve description of some WAL records with transaction commands This commit improves the description of some WAL records for the Transaction RMGR: - Track remote_apply for a transaction commit. This GUC is user-settable, so this information can be useful for debugging. - Add replication origin

pgsql: Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

2021-12-12 Thread Tom Lane
Suppress -Warray-parameter warnings in pgcrypto/sha2.c. This is exactly the same problem as commit 1b242f42b fixed in ecpg, but in contrib/pgcrypto. Commit 273c458a2 eliminated the problem here for v10 and up. We hadn't noticed for exactly the same reasons enumerated in bbbf22cf3. Back-patch do

pgsql: Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

2021-12-12 Thread Tom Lane
Suppress -Warray-parameter warnings in pgcrypto/sha2.c. This is exactly the same problem as commit 1b242f42b fixed in ecpg, but in contrib/pgcrypto. Commit 273c458a2 eliminated the problem here for v10 and up. We hadn't noticed for exactly the same reasons enumerated in bbbf22cf3. Back-patch do

pgsql: Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

2021-12-12 Thread Tom Lane
Suppress -Warray-parameter warnings in pgcrypto/sha2.c. This is exactly the same problem as commit 1b242f42b fixed in ecpg, but in contrib/pgcrypto. Commit 273c458a2 eliminated the problem here for v10 and up. We hadn't noticed for exactly the same reasons enumerated in bbbf22cf3. Back-patch do

pgsql: Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

2021-12-12 Thread Tom Lane
Suppress -Warray-parameter warnings in pgcrypto/sha2.c. This is exactly the same problem as commit 1b242f42b fixed in ecpg, but in contrib/pgcrypto. Commit 273c458a2 eliminated the problem here for v10 and up. We hadn't noticed for exactly the same reasons enumerated in bbbf22cf3. Back-patch do

pgsql: Suppress -Warray-parameter warnings in pgcrypto/sha2.c.

2021-12-12 Thread Tom Lane
Suppress -Warray-parameter warnings in pgcrypto/sha2.c. This is exactly the same problem as commit 1b242f42b fixed in ecpg, but in contrib/pgcrypto. Commit 273c458a2 eliminated the problem here for v10 and up. We hadn't noticed for exactly the same reasons enumerated in bbbf22cf3. Back-patch do

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Reformat imath.c macro to remove -Wmisleading-indentation warnin

2021-12-12 Thread Tom Lane
Reformat imath.c macro to remove -Wmisleading-indentation warnings. Recent versions of gcc whine about the admittedly-completely-illegible formatting of this macro. We've not noticed for a few reasons: * In v12 and up, the problem is gone thanks to 48e24ba6b. (Back-patching that doesn't seem pru

pgsql: Clean up compilation warnings coming from PL/Perl with clang-12~

2021-12-12 Thread Tom Lane
Clean up compilation warnings coming from PL/Perl with clang-12~ clang-12 has introduced -Wcompound-token-split-by-macro, that is causing a large amount of warnings when building PL/Perl because of its interactions with upstream Perl. This commit adds one -Wno to CFLAGS at ./configure time if the

pgsql: Clean up compilation warnings coming from PL/Perl with clang-12~

2021-12-12 Thread Tom Lane
Clean up compilation warnings coming from PL/Perl with clang-12~ clang-12 has introduced -Wcompound-token-split-by-macro, that is causing a large amount of warnings when building PL/Perl because of its interactions with upstream Perl. This commit adds one -Wno to CFLAGS at ./configure time if the

pgsql: Clean up compilation warnings coming from PL/Perl with clang-12~

2021-12-12 Thread Tom Lane
Clean up compilation warnings coming from PL/Perl with clang-12~ clang-12 has introduced -Wcompound-token-split-by-macro, that is causing a large amount of warnings when building PL/Perl because of its interactions with upstream Perl. This commit adds one -Wno to CFLAGS at ./configure time if the

pgsql: Clean up compilation warnings coming from PL/Perl with clang-12~

2021-12-12 Thread Tom Lane
Clean up compilation warnings coming from PL/Perl with clang-12~ clang-12 has introduced -Wcompound-token-split-by-macro, that is causing a large amount of warnings when building PL/Perl because of its interactions with upstream Perl. This commit adds one -Wno to CFLAGS at ./configure time if the

pgsql: Clean up compilation warnings coming from PL/Perl with clang-12~

2021-12-12 Thread Tom Lane
Clean up compilation warnings coming from PL/Perl with clang-12~ clang-12 has introduced -Wcompound-token-split-by-macro, that is causing a large amount of warnings when building PL/Perl because of its interactions with upstream Perl. This commit adds one -Wno to CFLAGS at ./configure time if the

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-12-12 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-12-12 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Make ecpg's rjulmdy() and rmdyjul() agree with their declaration

2021-12-12 Thread Tom Lane
Make ecpg's rjulmdy() and rmdyjul() agree with their declarations. We had "short *mdy" in the extern declarations, but "short mdy[3]" in the actual function definitions. Per C99 these are equivalent, but recent versions of gcc have started to issue warnings about the inconsistency. Clean it up b

pgsql: Use -Wno-format-truncation and -Wno-stringop-truncation, if avai

2021-12-12 Thread Tom Lane
Use -Wno-format-truncation and -Wno-stringop-truncation, if available. This back-patches commit e71658523 into out-of-support branches, pursuant to newly-established project policy. The point is to suppress scary-looking warnings so that people building these branches needn't expend brain cells v

pgsql: Make pg_upgrade's test.sh less chatty.

2021-12-12 Thread Tom Lane
Make pg_upgrade's test.sh less chatty. Remove "set -x", and pass "-A trust" to initdb explicitly, to suppress almost all of the noise this script used to emit on stderr. This back-patches commit eb9812f27 into out-of-support branches, pursuant to newly-established project policy. The point is to

pgsql: Make pg_upgrade's test.sh less chatty.

2021-12-12 Thread Tom Lane
Make pg_upgrade's test.sh less chatty. Remove "set -x", and pass "-A trust" to initdb explicitly, to suppress almost all of the noise this script used to emit on stderr. This back-patches commit eb9812f27 into out-of-support branches, pursuant to newly-established project policy. The point is to

pgsql: Add checks for valid multibyte character length in UtfToLocal, L

2021-12-12 Thread Tom Lane
Add checks for valid multibyte character length in UtfToLocal, LocalToUtf. This back-patches commit d9f37e666 into out-of-support branches, pursuant to newly-established project policy. The point is to suppress "uninitialized variable" warnings so that people building these branches needn't expen

pgsql: Add checks for valid multibyte character length in UtfToLocal, L

2021-12-12 Thread Tom Lane
Add checks for valid multibyte character length in UtfToLocal, LocalToUtf. This back-patches commit d9f37e666 into out-of-support branches, pursuant to newly-established project policy. The point is to suppress "uninitialized variable" warnings so that people building these branches needn't expen

pgsql: Use return instead of exit() in configure

2021-12-12 Thread Tom Lane
Use return instead of exit() in configure Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). This back-patches commit 1c0cf52b3 into out-of-support branches, pursuant to a newly-established project policy that we'll try to keep out-of-sup

pgsql: Use return instead of exit() in configure

2021-12-12 Thread Tom Lane
Use return instead of exit() in configure Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). This back-patches commit 1c0cf52b3 into out-of-support branches, pursuant to a newly-established project policy that we'll try to keep out-of-sup

pgsql: Use return instead of exit() in configure

2021-12-12 Thread Tom Lane
Use return instead of exit() in configure Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). This back-patches commit 1c0cf52b3 into out-of-support branches, pursuant to a newly-established project policy that we'll try to keep out-of-sup