[PATCH] fix compilation with gnu89

From: Rosen Penev <rosenp(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] fix compilation with gnu89
Date: 2020-11-30 04:33:41
Message-ID: 1606710821-16577-1-git-send-email-rosenp@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

GCC 4.8.5 does not default to gnu99 or gnu11 like the newer versions.
---
src/common/logging.c | 3 ++-
src/common/unicode_norm.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/common/logging.c b/src/common/logging.c
index f3fc0b8..2ac502a 100644
--- a/src/common/logging.c
+++ b/src/common/logging.c
@@ -112,7 +112,8 @@ pg_logging_init(const char *argv0)

if (colors)
{
- for (char *token = strtok(colors, ":"); token; token = strtok(NULL, ":"))
+ char *token;
+ for (token = strtok(colors, ":"); token; token = strtok(NULL, ":"))
{
char *e = strchr(token, '=');

diff --git a/src/common/unicode_norm.c b/src/common/unicode_norm.c
index ab5ce59..0de2e87 100644
--- a/src/common/unicode_norm.c
+++ b/src/common/unicode_norm.c
@@ -519,6 +519,7 @@ unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const pg_wchar *
{
uint8 lastCanonicalClass = 0;
UnicodeNormalizationQC result = UNICODE_NORM_QC_YES;
+ const pg_wchar *p;

/*
* For the "D" forms, we don't run the quickcheck. We don't include the
@@ -530,7 +531,7 @@ unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const pg_wchar *
if (form == UNICODE_NFD || form == UNICODE_NFKD)
return UNICODE_NORM_QC_MAYBE;

- for (const pg_wchar *p = input; *p; p++)
+ for (p = input; *p; p++)
{
pg_wchar ch = *p;
uint8 canonicalClass;
--
1.8.3.1

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-30 04:44:38 Re: Improving spin-lock implementation on ARM.
Previous Message Craig Ringer 2020-11-30 03:59:38 Notes on physical replica failover with logical publisher or subscriber