diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-02-27 17:21:31 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-02-27 17:21:31 -0500 |
commit | 728560db7d868b3ded9a8675742083ab89bcff7c (patch) | |
tree | 8ef600b8d46773eddddfb0c2f90782b3d6c00803 /src/backend/utils/adt/misc.c | |
parent | 53fe7e6cb81b26218f8652f5f3fe4fece944f958 (diff) | |
download | postgresql-728560db7d868b3ded9a8675742083ab89bcff7c.tar.gz postgresql-728560db7d868b3ded9a8675742083ab89bcff7c.zip |
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
Diffstat (limited to 'src/backend/utils/adt/misc.c')
0 files changed, 0 insertions, 0 deletions