postgresql/src/bin/pgbench
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
..
t Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
.gitignore Build all Flex files standalone 2022-09-04 12:09:01 +07:00
exprparse.y Suppress variable-set-but-not-used warnings from clang 15. 2022-09-20 12:04:37 -04:00
exprscan.l Build all Flex files standalone 2022-09-04 12:09:01 +07:00
Makefile Build all Flex files standalone 2022-09-04 12:09:01 +07:00
pgbench.c Add missing serial commas 2022-09-19 06:35:01 -04:00
pgbench.h Update copyright for 2022 2022-01-07 19:04:57 -05:00