Silencing the remaining clang 15 warnings
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-09-19T19:20:43Z
Lists: pgsql-hackers
Attachments
- silence-clang-15-warnings.patch (text/x-diff) patch
While working on the -Wdeprecated-non-prototype fixups discussed nearby, I saw that clang 15.0 produces a few other new warnings (which are also visible in the buildfarm). Pursuant to our usual policy that we should suppress warnings on compilers likely to be used for development, here's a patch to silence them. There are three groups of these: * With %pure-parser, Bison makes the "yynerrs" variable local instead of static, and then if you don't use it clang notices that it's set but never read. There doesn't seem to be a way to persuade Bison not to emit the variable at all, so here I've just added "(void) yynerrs;" to the topmost production of each affected grammar. If anyone has a nicer idea, let's hear it. * xlog.c's AdvanceXLInsertBuffer has a local variable "npages" that is only read in the "#ifdef WAL_DEBUG" stanza at the bottom. Here I've done the rather ugly and brute-force thing of wrapping all the variable's references in "#ifdef WAL_DEBUG". (I tried marking it PG_USED_FOR_ASSERTS_ONLY, but oddly that did not silence the warning.) I kind of wonder how useful this function's WAL_DEBUG output is --- maybe just dropping that altogether would be better? * array_typanalyze.c's compute_array_stats counts the number of null arrays in the column, but then does nothing with the result. AFAICS this is redundant with what std_compute_stats will do, so I just removed the variable. Any thoughts? regards, tom lane
Commits
-
Fix configure's AC_CHECK_DECLS tests to work correctly with clang.
- f6ce9cee6207 9.3 (unreleased) landed
- b8464d2f5da0 9.2 (unreleased) landed
-
Suppress more variable-set-but-not-used warnings from clang 15.
- db8e36682d95 13.9 landed
- c705646b751e 9.6 (unreleased) landed
- bf216123446c 9.3 (unreleased) landed
- bb8dbc9f2512 11.18 landed
- 9c69e2640fa8 10.23 landed
- 9a2267bcfc7d 12.13 landed
- 96e595124ee8 9.5 (unreleased) landed
- 88c947cb5261 14.6 landed
- 850cb88e4b60 9.2 (unreleased) landed
- 3c5a33a52e3a 9.4 (unreleased) landed
-
Suppress variable-set-but-not-used warnings from clang 15.
- f38a0bde2177 12.13 landed
- ca3b730baa13 13.9 landed
- b7d9b0c2667e 15.0 landed
- 85c077f9e022 9.6 (unreleased) landed
- 760308704378 10.23 landed
- 6ae8aee0b67b 11.18 landed
- 612e7966127e 9.5 (unreleased) landed
- 2e124d857a64 14.6 landed
- 152c9f7b8f01 16.0 landed