postgres.git / summary / log / commit / refs

commit    7bc88c3d6f3af3af5330c0e209c8a3c411267d00
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Fri Dec 05 03:30:43 2025 +0000

    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


src/backend/utils/adt/pg_dependencies.c | 6 +++--- src/backend/utils/adt/pg_ndistinct.c | 4 ++-- 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; [parent: 83f2f8413e8d]