Merge pull request #226 from fmbiete/patch-1

PG-289 - Don't fail to build with C11 compilers
pull/234/head
Kai Wagner 2022-05-17 09:01:10 +02:00 committed by GitHub
commit f0af45b3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

4
guc.c
View File

@ -34,7 +34,7 @@ static bool check_histogram_max(int *newval, void **extra, GucSource source);
void
init_guc(void)
{
int i = 0;
int i = 0, j;
conf[i] = (GucVariable) {
.guc_name = "pg_stat_monitor.pgsm_max",
@ -191,7 +191,7 @@ init_guc(void)
.guc_unit = 0,
.guc_value = &PGSM_TRACK
};
for (int j = 0; j < conf[i].n_options; ++j) {
for (j = 0; j < conf[i].n_options; ++j) {
strlcpy(conf[i].guc_options[j], track_options[j].name, sizeof(conf[i].guc_options[j]));
}
DefineEnumGUC(&conf[i++], track_options);

View File

@ -3399,8 +3399,9 @@ pg_stat_monitor_settings(PG_FUNCTION_ARGS)
if (conf->type == PGC_ENUM)
{
size_t i;
strcat(options, conf->guc_options[0]);
for (size_t i = 1; i < conf->n_options; ++i)
for (i = 1; i < conf->n_options; ++i)
{
strcat(options, ", ");
strcat(options, conf->guc_options[i]);