postgresql/src
Tom Lane 728560db7d Suppress compiler warnings in new pgstats code.
Some clang versions whine about comparing an enum variable to
a value outside the range of the enum, on the grounds that the
result must be constant.  In the cases we fix here, the loops
will terminate only if the enum variable can in fact hold a
value one beyond its declared range.  While that's very likely
to always be true for these enum types, it still seems like a
poor coding practice to assume it; so use "int" loop variables
instead to silence the warnings.  (This matches what we've done
in other places, for example loops over the range of ForkNumber.)

While at it, let's drop the XXX_FIRST macros for these enums and just
write zeroes for the loop start values.  The apparent flexibility
seems rather illusory given that iterating up to one-less-than-
the-number-of-values is only correct for a zero-based range.

Melanie Plageman

Discussion: https://postgr.es/m/20520.1677435600@sss.pgh.pa.us
2023-02-27 17:21:31 -05:00
..
backend Suppress compiler warnings in new pgstats code. 2023-02-27 17:21:31 -05:00
bin Disallow NULLS NOT DISTINCT indexes for primary keys 2023-02-24 11:09:50 +01:00
common Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
fe_utils Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
include Suppress compiler warnings in new pgstats code. 2023-02-27 17:21:31 -05:00
interfaces Check for unbounded authentication exchanges in libpq. 2023-02-22 21:27:38 +02:00
makefiles Update copyright for 2023 2023-01-02 15:00:37 -05:00
pl Add missing support for the latest SPI status codes. 2023-02-22 13:23:09 +00:00
port Remove gratuitous references to postmaster program 2023-01-26 10:48:32 +01:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Fix MULTIEXPR_SUBLINK with partitioned target tables, yet again. 2023-02-25 14:44:14 -05:00
timezone Update time zone data files to tzdata release 2022g. 2023-01-31 17:36:55 -05:00
tools Don't force SQL_ASCII/no-locale for installcheck in vcregress.pl 2023-02-26 06:48:41 -05:00
tutorial Remove useless casts to (void *) in arguments of some system functions 2023-02-07 06:57:59 +01:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00