summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-12-05 12:30:43 +0900
committerMichael Paquier <michael@paquier.xyz>2025-12-05 12:30:43 +0900
commit7bc88c3d6f3af3af5330c0e209c8a3c411267d00 (patch)
tree560a3efbea76a9ba4eb44fa22f83fe81c125bf45
parent83f2f8413e8d9687fda7d5881c82b89b8d9d4043 (diff)
Fix some compiler warnings
Some of the buildfarm members with some old gcc versions have been complaining about an always-true test for a NULL pointer caused by a combination of SOFT_ERROR_OCCURRED() and a local ErrorSaveContext variable. These warnings are taken care of by removing SOFT_ERROR_OCCURRED(), switching to a direct variable check, like 56b1e88c804b. Oversights in e1405aa5e3ac and 44eba8f06e55. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/1341064.1764895052@sss.pgh.pa.us
-rw-r--r--src/backend/utils/adt/pg_dependencies.c6
-rw-r--r--src/backend/utils/adt/pg_ndistinct.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/pg_dependencies.c b/src/backend/utils/adt/pg_dependencies.c
index 56abb744177..236790b1439 100644
--- a/src/backend/utils/adt/pg_dependencies.c
+++ b/src/backend/utils/adt/pg_dependencies.c
@@ -494,7 +494,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
case DEPS_EXPECT_ATTNUM:
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
- if (SOFT_ERROR_OCCURRED(&escontext))
+ if (escontext.error_occurred)
{
errsave(parse->escontext,
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -539,7 +539,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
parse->dependency = (AttrNumber)
pg_strtoint16_safe(token, (Node *) &escontext);
- if (SOFT_ERROR_OCCURRED(&escontext))
+ if (escontext.error_occurred)
{
errsave(parse->escontext,
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -569,7 +569,7 @@ dependencies_scalar(void *state, char *token, JsonTokenType tokentype)
parse->degree = float8in_internal(token, NULL, "double",
token, (Node *) &escontext);
- if (SOFT_ERROR_OCCURRED(&escontext))
+ if (escontext.error_occurred)
{
errsave(parse->escontext,
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
diff --git a/src/backend/utils/adt/pg_ndistinct.c b/src/backend/utils/adt/pg_ndistinct.c
index 5292521b169..a2bce48fda0 100644
--- a/src/backend/utils/adt/pg_ndistinct.c
+++ b/src/backend/utils/adt/pg_ndistinct.c
@@ -435,7 +435,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenType tokentype)
case NDIST_EXPECT_ATTNUM:
attnum = pg_strtoint16_safe(token, (Node *) &escontext);
- if (SOFT_ERROR_OCCURRED(&escontext))
+ if (escontext.error_occurred)
{
errsave(parse->escontext,
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -485,7 +485,7 @@ ndistinct_scalar(void *state, char *token, JsonTokenType tokentype)
*/
parse->ndistinct = pg_strtoint32_safe(token, (Node *) &escontext);
- if (!SOFT_ERROR_OCCURRED(&escontext))
+ if (!escontext.error_occurred)
{
parse->state = NDIST_EXPECT_KEY;
return JSON_SUCCESS;