postgresql/src/backend
Tom Lane 152c9f7b8f Suppress variable-set-but-not-used warnings from clang 15.
clang 15+ will issue a set-but-not-used warning when the only
use of a variable is in autoincrements (e.g., "foo++;").
That's perfectly sensible, but it detects a few more cases that
we'd not noticed before.  Silence the warnings with our usual
methods, such as PG_USED_FOR_ASSERTS_ONLY, or in one case by
actually removing a useless variable.

One thing that we can't nicely get rid of is that with %pure-parser,
Bison emits "yynerrs" as a local variable that falls foul of this
warning.  To silence those, I inserted "(void) yynerrs;" in the
top-level productions of affected grammars.

Per recently-established project policy, this is a candidate
for back-patching into out-of-support branches: it suppresses
annoying compiler warnings but changes no behavior.  Hence,
back-patch to 9.5, which is as far as these patches go without
issues.  (A preliminary check shows that the prior branches
need some other set-but-not-used cleanups too, so I'll leave
them for another day.)

Discussion: https://postgr.es/m/514615.1663615243@sss.pgh.pa.us
2022-09-20 12:04:37 -04:00
..
access Suppress variable-set-but-not-used warnings from clang 15. 2022-09-20 12:04:37 -04:00
backup Message style improvements 2022-09-17 08:15:11 +02:00
bootstrap Bump minimum version of Bison to 2.3 2022-09-09 12:31:41 +07:00
catalog Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
commands Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
executor Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
foreign Adjust assorted hint messages that list all valid options. 2022-09-16 14:53:12 +02:00
jit Fix an assortment of improper usages of string functions 2022-09-06 13:19:44 +12:00
lib Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
libpq Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
main Fix outdated --help message for postgres -f 2022-08-15 13:36:36 +09:00
nodes Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
optimizer Fix misleading comment for get_cheapest_group_keys_order 2022-09-20 10:03:26 +12:00
parser Suppress variable-set-but-not-used warnings from clang 15. 2022-09-20 12:04:37 -04:00
partitioning Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
po NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00
port Fix huge_pages on Windows 2022-09-17 15:39:55 +09:00
postmaster Fix grammar in error message 2022-09-15 11:40:17 +07:00
regex Consistently use named parameters in regex code consistently. 2022-09-19 15:47:04 -07:00
replication Fix incorrect variable types for origin IDs in decode.c 2022-09-20 18:13:00 +09:00
rewrite Fix grammar in error message 2022-09-15 11:40:17 +07:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrect uses of Datum conversion macros 2022-09-05 13:30:44 +02:00
storage Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
tcop Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
tsearch Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
utils Suppress variable-set-but-not-used warnings from clang 15. 2022-09-20 12:04:37 -04:00
.gitignore
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
nls.mk NLS: Put list of available languages into LINGUAS files 2022-07-13 08:19:17 +02:00