From f19cf31fe078a58dba9d845720fd14183f37ddd6 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 9 Nov 2020 15:33:47 +0100 Subject: [PATCH v1 2/3] Fix -Wformat-signedness warnings for enums see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66249 --- contrib/intarray/_int_selfuncs.c | 2 +- contrib/jsonb_plperl/jsonb_plperl.c | 6 ++--- contrib/jsonb_plpython/jsonb_plpython.c | 8 +++---- contrib/postgres_fdw/deparse.c | 2 +- contrib/postgres_fdw/postgres_fdw.c | 2 +- contrib/xml2/xpath.c | 4 ++-- src/backend/access/common/reloptions.c | 4 ++-- src/backend/access/gin/ginbtree.c | 2 +- src/backend/access/transam/multixact.c | 2 +- src/backend/access/transam/xlog.c | 6 ++--- src/backend/catalog/aclchk.c | 6 ++--- src/backend/catalog/objectaddress.c | 2 +- src/backend/catalog/pg_shdepend.c | 2 +- src/backend/commands/discard.c | 2 +- src/backend/commands/functioncmds.c | 2 +- src/backend/commands/subscriptioncmds.c | 2 +- src/backend/commands/tsearchcmds.c | 2 +- src/backend/executor/execMain.c | 2 +- src/backend/lib/rbtree.c | 2 +- src/backend/optimizer/path/costsize.c | 4 ++-- src/backend/optimizer/path/indxpath.c | 2 +- src/backend/optimizer/plan/createplan.c | 4 ++-- src/backend/parser/parse_clause.c | 4 ++-- src/backend/parser/parse_expr.c | 4 ++-- src/backend/parser/parse_relation.c | 2 +- src/backend/parser/parse_utilcmd.c | 6 ++--- src/backend/postmaster/autovacuum.c | 2 +- src/backend/replication/basebackup.c | 2 +- src/backend/statistics/mcv.c | 2 +- src/backend/tsearch/spell.c | 2 +- src/backend/utils/adt/acl.c | 4 ++-- src/backend/utils/adt/geo_spgist.c | 2 +- src/backend/utils/adt/json.c | 2 +- src/backend/utils/adt/jsonb.c | 4 ++-- src/backend/utils/adt/jsonb_gin.c | 6 ++--- src/backend/utils/adt/jsonpath.c | 8 +++---- src/backend/utils/adt/jsonpath_exec.c | 10 ++++----- src/backend/utils/adt/ruleutils.c | 2 +- src/backend/utils/adt/xml.c | 2 +- src/backend/utils/misc/guc.c | 4 ++-- src/bin/pg_dump/pg_backup_archiver.c | 6 ++--- src/bin/pgbench/pgbench.c | 2 +- src/bin/psql/common.c | 8 +++---- src/fe_utils/print.c | 2 +- src/interfaces/ecpg/ecpglib/descriptor.c | 6 ++--- src/interfaces/ecpg/ecpglib/execute.c | 2 +- src/interfaces/ecpg/preproc/descriptor.c | 4 ++-- src/interfaces/ecpg/preproc/ecpg.addons | 10 ++++----- src/interfaces/ecpg/preproc/output.c | 8 +++---- src/interfaces/ecpg/preproc/type.c | 6 ++--- src/interfaces/libpq/fe-connect.c | 2 +- src/interfaces/libpq/fe-protocol2.c | 4 ++-- src/pl/plpgsql/src/pl_comp.c | 8 +++---- src/pl/plpgsql/src/pl_exec.c | 28 ++++++++++++------------ src/pl/plpgsql/src/pl_funcs.c | 10 ++++----- src/pl/plpgsql/src/pl_gram.y | 4 ++-- 56 files changed, 124 insertions(+), 124 deletions(-) diff --git a/contrib/intarray/_int_selfuncs.c b/contrib/intarray/_int_selfuncs.c index a3a538a20d..8eba2efd30 100644 --- a/contrib/intarray/_int_selfuncs.c +++ b/contrib/intarray/_int_selfuncs.c @@ -310,7 +310,7 @@ int_query_opr_selec(ITEM *item, Datum *mcelems, float4 *mcefreqs, } else { - elog(ERROR, "unrecognized int query item type: %u", item->type); + elog(ERROR, "unrecognized int query item type: %d", item->type); selec = 0; /* keep compiler quiet */ } diff --git a/contrib/jsonb_plperl/jsonb_plperl.c b/contrib/jsonb_plperl/jsonb_plperl.c index 22e90afe1b..e74f52d903 100644 --- a/contrib/jsonb_plperl/jsonb_plperl.c +++ b/contrib/jsonb_plperl/jsonb_plperl.c @@ -51,7 +51,7 @@ JsonbValue_to_SV(JsonbValue *jbv) return newSV(0); default: - elog(ERROR, "unexpected jsonb value type: %d", jbv->type); + elog(ERROR, "unexpected jsonb value type: %u", jbv->type); return NULL; } } @@ -77,7 +77,7 @@ Jsonb_to_SV(JsonbContainer *jsonb) if ((r = JsonbIteratorNext(&it, &v, true)) != WJB_ELEM || (r = JsonbIteratorNext(&it, &tmp, true)) != WJB_END_ARRAY || (r = JsonbIteratorNext(&it, &tmp, true)) != WJB_DONE) - elog(ERROR, "unexpected jsonb token: %d", r); + elog(ERROR, "unexpected jsonb token: %u", r); return JsonbValue_to_SV(&v); } @@ -120,7 +120,7 @@ Jsonb_to_SV(JsonbContainer *jsonb) } default: - elog(ERROR, "unexpected jsonb token: %d", r); + elog(ERROR, "unexpected jsonb token: %u", r); return NULL; } } diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index 836c178770..d88363c67a 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -127,7 +127,7 @@ PLyObject_FromJsonbValue(JsonbValue *jsonbValue) Py_RETURN_FALSE; default: - elog(ERROR, "unexpected jsonb value type: %d", jsonbValue->type); + elog(ERROR, "unexpected jsonb value type: %u", jsonbValue->type); return NULL; } } @@ -158,7 +158,7 @@ PLyObject_FromJsonbContainer(JsonbContainer *jsonb) if ((r = JsonbIteratorNext(&it, &v, true)) != WJB_ELEM || (r = JsonbIteratorNext(&it, &tmp, true)) != WJB_END_ARRAY || (r = JsonbIteratorNext(&it, &tmp, true)) != WJB_DONE) - elog(ERROR, "unexpected jsonb token: %d", r); + elog(ERROR, "unexpected jsonb token: %u", r); result = PLyObject_FromJsonbValue(&v); } @@ -219,7 +219,7 @@ PLyObject_FromJsonbContainer(JsonbContainer *jsonb) } if ((r = JsonbIteratorNext(&it, &v, true)) != WJB_VALUE) - elog(ERROR, "unexpected jsonb token: %d", r); + elog(ERROR, "unexpected jsonb token: %u", r); val = PLyObject_FromJsonbValue(&v); if (!val) @@ -253,7 +253,7 @@ PLyObject_FromJsonbContainer(JsonbContainer *jsonb) break; default: - elog(ERROR, "unexpected jsonb token: %d", r); + elog(ERROR, "unexpected jsonb token: %u", r); return NULL; } diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index 2d44df19fe..9e3bfe7621 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -1384,7 +1384,7 @@ get_jointype_name(JoinType jointype) default: /* Shouldn't come here, but protect from buggy code. */ - elog(ERROR, "unsupported join type %d", jointype); + elog(ERROR, "unsupported join type %u", jointype); } /* Keep compiler happy */ diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 9c5aaacc51..ae6e304eb3 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -5195,7 +5195,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype, default: /* Should not happen, we have just checked this above */ - elog(ERROR, "unsupported join type %d", jointype); + elog(ERROR, "unsupported join type %u", jointype); } /* diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index 1e5b71d9a0..3e1ff0f87e 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -502,7 +502,7 @@ pgxml_result_to_text(xmlXPathObjectPtr res, break; default: - elog(NOTICE, "unsupported XQuery result: %d", res->type); + elog(NOTICE, "unsupported XQuery result: %u", res->type); xpresstr = xmlStrdup((const xmlChar *) ""); } @@ -777,7 +777,7 @@ xpath_table(PG_FUNCTION_ARGS) break; default: - elog(NOTICE, "unsupported XQuery result: %d", res->type); + elog(NOTICE, "unsupported XQuery result: %u", res->type); resstr = xmlStrdup((const xmlChar *) ""); } diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 8ccc228a8c..517ef2bcd1 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -1659,7 +1659,7 @@ parse_one_reloption(relopt_value *option, char *text_str, int text_len, } break; default: - elog(ERROR, "unsupported reloption type %d", option->gen->type); + elog(ERROR, "unsupported reloption type %u", option->gen->type); parsed = true; /* quiet compiler */ break; } @@ -1794,7 +1794,7 @@ fillRelOptions(void *rdopts, Size basesize, } break; default: - elog(ERROR, "unsupported reloption type %d", + elog(ERROR, "unsupported reloption type %u", options[i].gen->type); break; } diff --git a/src/backend/access/gin/ginbtree.c b/src/backend/access/gin/ginbtree.c index 82788a5c36..02bc68c1dc 100644 --- a/src/backend/access/gin/ginbtree.c +++ b/src/backend/access/gin/ginbtree.c @@ -642,7 +642,7 @@ ginPlaceToPage(GinBtree btree, GinBtreeStack *stack, } else { - elog(ERROR, "invalid return code from GIN beginPlaceToPage method: %d", rc); + elog(ERROR, "invalid return code from GIN beginPlaceToPage method: %u", rc); result = false; /* keep compiler quiet */ } diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index eb8de7cf32..f885ac9548 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -1643,7 +1643,7 @@ mxstatus_to_string(MultiXactStatus status) case MultiXactStatusUpdate: return "upd"; default: - elog(ERROR, "unrecognized multixact status %d", status); + elog(ERROR, "unrecognized multixact status %u", status); return ""; } } diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index a1078a7cfc..a71b55341f 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -3699,7 +3699,7 @@ XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli, break; default: - elog(ERROR, "invalid XLogFileRead source %d", source); + elog(ERROR, "invalid XLogFileRead source %u", source); } /* @@ -12254,7 +12254,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, break; default: - elog(ERROR, "unexpected WAL source %d", currentSource); + elog(ERROR, "unexpected WAL source %u", currentSource); } } else if (currentSource == XLOG_FROM_PG_WAL) @@ -12506,7 +12506,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, } default: - elog(ERROR, "unexpected WAL source %d", currentSource); + elog(ERROR, "unexpected WAL source %u", currentSource); } /* diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index c626161408..7553b68181 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -259,7 +259,7 @@ restrict_and_check_grant(bool is_grant, AclMode avail_goptions, bool all_privs, whole_mask = ACL_ALL_RIGHTS_TYPE; break; default: - elog(ERROR, "unrecognized object type: %d", objtype); + elog(ERROR, "unrecognized object type: %u", objtype); /* not reached, but keep compiler quiet */ return ACL_NO_RIGHTS; } @@ -3422,7 +3422,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype, case OBJECT_TSPARSER: case OBJECT_TSTEMPLATE: case OBJECT_USER_MAPPING: - elog(ERROR, "unsupported object type %d", objtype); + elog(ERROR, "unsupported object type %u", objtype); } ereport(ERROR, @@ -3558,7 +3558,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype, case OBJECT_TSPARSER: case OBJECT_TSTEMPLATE: case OBJECT_USER_MAPPING: - elog(ERROR, "unsupported object type %d", objtype); + elog(ERROR, "unsupported object type %u", objtype); } ereport(ERROR, diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index 3662a8ebb6..b655946d9a 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -2328,7 +2328,7 @@ pg_get_object_address(PG_FUNCTION_ARGS) } if (objnode == NULL) - elog(ERROR, "unrecognized object type: %d", type); + elog(ERROR, "unrecognized object type: %u", type); addr = get_object_address(type, objnode, &relation, AccessShareLock, false); diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c index 3dd7afd343..7751a23a60 100644 --- a/src/backend/catalog/pg_shdepend.c +++ b/src/backend/catalog/pg_shdepend.c @@ -1215,7 +1215,7 @@ storeObjectDescription(StringInfo descs, break; default: - elog(ERROR, "unrecognized object type: %d", type); + elog(ERROR, "unrecognized object type: %u", type); } pfree(objdesc); diff --git a/src/backend/commands/discard.c b/src/backend/commands/discard.c index 90dfc58c24..f1712ae932 100644 --- a/src/backend/commands/discard.c +++ b/src/backend/commands/discard.c @@ -49,7 +49,7 @@ DiscardCommand(DiscardStmt *stmt, bool isTopLevel) break; default: - elog(ERROR, "unrecognized DISCARD target: %d", stmt->target); + elog(ERROR, "unrecognized DISCARD target: %u", stmt->target); } } diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index c3ce480c8f..fc084fba81 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -1632,7 +1632,7 @@ CreateCast(CreateCastStmt *stmt) castcontext = COERCION_CODE_EXPLICIT; break; default: - elog(ERROR, "unrecognized CoercionContext: %d", stmt->context); + elog(ERROR, "unrecognized CoercionContext: %u", stmt->context); castcontext = 0; /* keep compiler quiet */ break; } diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 1696454c0b..0bd577e344 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -883,7 +883,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt) } default: - elog(ERROR, "unrecognized ALTER SUBSCRIPTION kind %d", + elog(ERROR, "unrecognized ALTER SUBSCRIPTION kind %u", stmt->kind); } diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c index f5d1d137b8..606ae58cba 100644 --- a/src/backend/commands/tsearchcmds.c +++ b/src/backend/commands/tsearchcmds.c @@ -1692,7 +1692,7 @@ deserialize_deflist(Datum txt) } break; default: - elog(ERROR, "unrecognized deserialize_deflist state: %d", + elog(ERROR, "unrecognized deserialize_deflist state: %u", state); } } diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 7179f589f9..687ae46868 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -863,7 +863,7 @@ InitPlan(QueryDesc *queryDesc, int eflags) relation = NULL; break; default: - elog(ERROR, "unrecognized markType: %d", rc->markType); + elog(ERROR, "unrecognized markType: %u", rc->markType); relation = NULL; /* keep compiler quiet */ break; } diff --git a/src/backend/lib/rbtree.c b/src/backend/lib/rbtree.c index 28681b8f61..e379a3ce5b 100644 --- a/src/backend/lib/rbtree.c +++ b/src/backend/lib/rbtree.c @@ -753,7 +753,7 @@ rbt_begin_iterate(RBTree *rbt, RBTOrderControl ctrl, RBTreeIterator *iter) iter->iterate = rbt_right_left_iterator; break; default: - elog(ERROR, "unrecognized rbtree iteration order: %d", ctrl); + elog(ERROR, "unrecognized rbtree iteration order: %u", ctrl); } } diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index f1dfdc1a4a..ba31e55a0a 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -929,7 +929,7 @@ get_indexpath_pages(Path *bitmapqual) result = (double) ipath->indexinfo->pages; } else - elog(ERROR, "unrecognized node type: %d", nodeTag(bitmapqual)); + elog(ERROR, "unrecognized node type: %u", nodeTag(bitmapqual)); return result; } @@ -1077,7 +1077,7 @@ cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec) } else { - elog(ERROR, "unrecognized node type: %d", nodeTag(path)); + elog(ERROR, "unrecognized node type: %u", nodeTag(path)); *cost = *selec = 0; /* keep compiler quiet */ } } diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index bcb1bc6097..82c3407380 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -1761,7 +1761,7 @@ find_indexpath_quals(Path *bitmapqual, List **quals, List **preds) *preds = list_concat(*preds, ipath->indexinfo->indpred); } else - elog(ERROR, "unrecognized node type: %d", nodeTag(bitmapqual)); + elog(ERROR, "unrecognized node type: %u", nodeTag(bitmapqual)); } diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 40abe6f9f6..2c67d0a6b6 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -3334,7 +3334,7 @@ create_bitmap_subplan(PlannerInfo *root, Path *bitmapqual, } else { - elog(ERROR, "unrecognized node type: %d", nodeTag(bitmapqual)); + elog(ERROR, "unrecognized node type: %u", nodeTag(bitmapqual)); plan = NULL; /* keep compiler quiet */ } @@ -5200,7 +5200,7 @@ bitmap_subplan_mark_shared(Plan *plan) else if (IsA(plan, BitmapIndexScan)) ((BitmapIndexScan *) plan)->isshared = true; else - elog(ERROR, "unrecognized node type: %d", nodeTag(plan)); + elog(ERROR, "unrecognized node type: %u", nodeTag(plan)); } /***************************************************************************** diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index ea4a1f5aeb..0cde09b2f4 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -3339,7 +3339,7 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle, hashable = op_hashjoinable(eqop, restype); break; default: - elog(ERROR, "unrecognized sortby_dir: %d", sortby->sortby_dir); + elog(ERROR, "unrecognized sortby_dir: %u", sortby->sortby_dir); sortop = InvalidOid; /* keep compiler quiet */ eqop = InvalidOid; hashable = false; @@ -3373,7 +3373,7 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle, sortcl->nulls_first = false; break; default: - elog(ERROR, "unrecognized sortby_nulls: %d", + elog(ERROR, "unrecognized sortby_nulls: %u", sortby->sortby_nulls); break; } diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index f5165863d7..316a611497 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -250,7 +250,7 @@ transformExprRecurse(ParseState *pstate, Node *expr) result = transformExprRecurse(pstate, a->lexpr); break; default: - elog(ERROR, "unrecognized A_Expr kind: %d", a->kind); + elog(ERROR, "unrecognized A_Expr kind: %u", a->kind); result = NULL; /* keep compiler quiet */ break; } @@ -1475,7 +1475,7 @@ transformAExprBetween(ParseState *pstate, A_Expr *a) result = (Node *) makeBoolExpr(AND_EXPR, args, a->location); break; default: - elog(ERROR, "unrecognized A_Expr kind: %d", a->kind); + elog(ERROR, "unrecognized A_Expr kind: %u", a->kind); result = NULL; /* keep compiler quiet */ break; } diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index a56bd86181..e0b0349416 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -2362,7 +2362,7 @@ addRangeTableEntryForENR(ParseState *pstate, break; default: - elog(ERROR, "unexpected enrtype: %d", enrmd->enrtype); + elog(ERROR, "unexpected enrtype: %u", enrmd->enrtype); return NULL; /* for fussy compilers */ } diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 254c0f65c2..ad5fbb418c 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -784,7 +784,7 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column) break; default: - elog(ERROR, "unrecognized constraint type: %d", + elog(ERROR, "unrecognized constraint type: %u", constraint->contype); break; } @@ -906,12 +906,12 @@ transformTableConstraint(CreateStmtContext *cxt, Constraint *constraint) case CONSTR_ATTR_NOT_DEFERRABLE: case CONSTR_ATTR_DEFERRED: case CONSTR_ATTR_IMMEDIATE: - elog(ERROR, "invalid context for constraint type %d", + elog(ERROR, "invalid context for constraint type %u", constraint->contype); break; default: - elog(ERROR, "unrecognized constraint type: %d", + elog(ERROR, "unrecognized constraint type: %u", constraint->contype); break; } diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 2cef56f115..18957cece8 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2678,7 +2678,7 @@ perform_work_item(AutoVacuumWorkItem *workitem) Int64GetDatum((int64) workitem->avw_blockNumber)); break; default: - elog(WARNING, "unrecognized work item found: type %d", + elog(WARNING, "unrecognized work item found: type %u", workitem->avw_type); break; } diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index b89df01fa7..d67ddf7e54 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -1843,7 +1843,7 @@ _tarWriteHeader(const char *filename, const char *linktarget, filename, linktarget))); break; default: - elog(ERROR, "unrecognized tar error: %d", rc); + elog(ERROR, "unrecognized tar error: %u", rc); } pq_putmessage('d', h, sizeof(h)); diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c index 6a262f1543..bec14fbc57 100644 --- a/src/backend/statistics/mcv.c +++ b/src/backend/statistics/mcv.c @@ -1881,7 +1881,7 @@ mcv_get_match_bitmap(PlannerInfo *root, List *clauses, } } else - elog(ERROR, "unknown clause type: %d", clause->type); + elog(ERROR, "unknown clause type: %u", clause->type); } return matches; diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c index 05d08cfc01..0450de829e 100644 --- a/src/backend/tsearch/spell.c +++ b/src/backend/tsearch/spell.c @@ -420,7 +420,7 @@ getNextFlagFromString(IspellDict *Conf, char **sflagset, char *sflag) stop = true; break; default: - elog(ERROR, "unrecognized type of Conf->flagMode: %d", + elog(ERROR, "unrecognized type of Conf->flagMode: %u", Conf->flagMode); } diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index f97489f064..55e89bc895 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -5234,7 +5234,7 @@ get_rolespec_oid(const RoleSpec *role, bool missing_ok) break; default: - elog(ERROR, "unexpected role type %d", role->roletype); + elog(ERROR, "unexpected role type %u", role->roletype); } return oid; @@ -5281,7 +5281,7 @@ get_rolespec_tuple(const RoleSpec *role) break; default: - elog(ERROR, "unexpected role type %d", role->roletype); + elog(ERROR, "unexpected role type %u", role->roletype); } return tuple; diff --git a/src/backend/utils/adt/geo_spgist.c b/src/backend/utils/adt/geo_spgist.c index de7e6fa404..86feb6fcd3 100644 --- a/src/backend/utils/adt/geo_spgist.c +++ b/src/backend/utils/adt/geo_spgist.c @@ -541,7 +541,7 @@ spg_box_quad_get_scankey_bbox(ScanKey sk, bool *recheck) return &DatumGetPolygonP(sk->sk_argument)->boundbox; default: - elog(ERROR, "unrecognized scankey subtype: %d", sk->sk_subtype); + elog(ERROR, "unrecognized scankey subtype: %u", sk->sk_subtype); return NULL; } } diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 420d3cdcbb..cbeaa0a482 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1369,7 +1369,7 @@ json_typeof(PG_FUNCTION_ARGS) type = "null"; break; default: - elog(ERROR, "unexpected json token: %d", tok); + elog(ERROR, "unexpected json token: %u", tok); } PG_RETURN_TEXT_P(cstring_to_text(type)); diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index 1e9ca046c6..d0c4be2f8c 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -220,12 +220,12 @@ JsonbTypeName(JsonbValue *jbv) case TIMESTAMPTZOID: return "timestamp with time zone"; default: - elog(ERROR, "unrecognized jsonb value datetime type: %d", + elog(ERROR, "unrecognized jsonb value datetime type: %u", jbv->val.datetime.typid); } return "unknown"; default: - elog(ERROR, "unrecognized jsonb value type: %d", jbv->type); + elog(ERROR, "unrecognized jsonb value type: %u", jbv->type); return "unknown"; } } diff --git a/src/backend/utils/adt/jsonb_gin.c b/src/backend/utils/adt/jsonb_gin.c index aee3d9d673..b714cd827d 100644 --- a/src/backend/utils/adt/jsonb_gin.c +++ b/src/backend/utils/adt/jsonb_gin.c @@ -701,7 +701,7 @@ extract_jsp_bool_expr(JsonPathGinContext *cxt, JsonPathGinPath path, scalar_item->content.value.datalen; break; default: - elog(ERROR, "invalid scalar jsonpath item type: %d", + elog(ERROR, "invalid scalar jsonpath item type: %u", scalar_item->type); return NULL; } @@ -839,7 +839,7 @@ execute_jsp_gin_node(JsonPathGinNode *node, void *check, bool ternary) } default: - elog(ERROR, "invalid jsonpath gin node type: %d", node->type); + elog(ERROR, "invalid jsonpath gin node type: %u", node->type); return GIN_FALSE; /* keep compiler quiet */ } } @@ -1401,7 +1401,7 @@ make_scalar_key(const JsonbValue *scalarVal, bool is_key) scalarVal->val.string.len); break; default: - elog(ERROR, "unrecognized jsonb scalar type: %d", scalarVal->type); + elog(ERROR, "unrecognized jsonb scalar type: %u", scalarVal->type); item = 0; /* keep compiler quiet */ break; } diff --git a/src/backend/utils/adt/jsonpath.c b/src/backend/utils/adt/jsonpath.c index 31d9d92d14..91b5a74a74 100644 --- a/src/backend/utils/adt/jsonpath.c +++ b/src/backend/utils/adt/jsonpath.c @@ -419,7 +419,7 @@ flattenJsonPathParseItem(StringInfo buf, JsonPathParseItem *item, case jpiKeyValue: break; default: - elog(ERROR, "unrecognized jsonpath item type: %d", item->type); + elog(ERROR, "unrecognized jsonpath item type: %u", item->type); } if (item->next) @@ -707,7 +707,7 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, appendBinaryStringInfo(buf, ".keyvalue()", 11); break; default: - elog(ERROR, "unrecognized jsonpath item type: %d", v->type); + elog(ERROR, "unrecognized jsonpath item type: %u", v->type); } if (jspGetNext(v, &elem)) @@ -768,7 +768,7 @@ jspOperationName(JsonPathItemType type) case jpiDatetime: return "datetime"; default: - elog(ERROR, "unrecognized jsonpath item type: %d", type); + elog(ERROR, "unrecognized jsonpath item type: %u", type); return NULL; } } @@ -915,7 +915,7 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos) read_int32(v->content.anybounds.last, base, pos); break; default: - elog(ERROR, "unrecognized jsonpath item type: %d", v->type); + elog(ERROR, "unrecognized jsonpath item type: %u", v->type); } } diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index 1059f34130..f6f4cb6b40 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -855,7 +855,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp, bool hasNext = jspGetNext(jsp, &elem); if (jb->type != jbvBinary) - elog(ERROR, "invalid jsonb object type: %d", jb->type); + elog(ERROR, "invalid jsonb object type: %u", jb->type); return executeAnyItem (cxt, hasNext ? &elem : NULL, @@ -1106,7 +1106,7 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp, return executeKeyValueMethod(cxt, jsp, jb, found); default: - elog(ERROR, "unrecognized jsonpath item type: %d", jsp->type); + elog(ERROR, "unrecognized jsonpath item type: %u", jsp->type); } return res; @@ -1123,7 +1123,7 @@ executeItemUnwrapTargetArray(JsonPathExecContext *cxt, JsonPathItem *jsp, if (jb->type != jbvBinary) { Assert(jb->type != jbvArray); - elog(ERROR, "invalid jsonb array value type: %d", jb->type); + elog(ERROR, "invalid jsonb array value type: %u", jb->type); } return executeAnyItem @@ -1342,7 +1342,7 @@ executeBoolItem(JsonPathExecContext *cxt, JsonPathItem *jsp, } default: - elog(ERROR, "invalid boolean jsonpath item type: %d", jsp->type); + elog(ERROR, "invalid boolean jsonpath item type: %u", jsp->type); return jpbUnknown; } } @@ -2328,7 +2328,7 @@ compareItems(int32 op, JsonbValue *jb1, JsonbValue *jb2, bool useTz) return jpbUnknown; /* non-scalars are not comparable */ default: - elog(ERROR, "invalid jsonb value type %d", jb1->type); + elog(ERROR, "invalid jsonb value type %u", jb1->type); } switch (op) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index c2c6df2a4f..0681cc14e0 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -5051,7 +5051,7 @@ get_query_def(Query *query, StringInfo buf, List *parentnamespace, break; default: - elog(ERROR, "unrecognized query command type: %d", + elog(ERROR, "unrecognized query command type: %u", query->commandType); break; } diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 4c299057a6..5447786336 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -3947,7 +3947,7 @@ xml_xpathobjtoxmlarray(xmlXPathObjectPtr xpathobj, break; default: - elog(ERROR, "xpath expression result type %d is unsupported", + elog(ERROR, "xpath expression result type %u is unsupported", xpathobj->type); return 0; /* keep compiler quiet */ } diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index bb34630e8e..bb5d473cdb 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -8196,7 +8196,7 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) break; default: - elog(ERROR, "unrecognized alter system stmt type: %d", + elog(ERROR, "unrecognized alter system stmt type: %u", altersysstmt->setstmt->kind); break; } @@ -9205,7 +9205,7 @@ get_explain_guc_options(int *num) break; default: - elog(ERROR, "unexpected GUC type: %d", conf->vartype); + elog(ERROR, "unexpected GUC type: %u", conf->vartype); } if (!modified) diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index b961a24b36..0861a2fc87 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -2264,7 +2264,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt, { ArchiveHandle *AH; - pg_log_debug("allocating AH for %s, format %d", + pg_log_debug("allocating AH for %s, format %u", FileSpec ? FileSpec : "(stdio)", fmt); AH = (ArchiveHandle *) pg_malloc0(sizeof(ArchiveHandle)); @@ -2361,7 +2361,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt, break; default: - fatal("unrecognized file format \"%d\"", fmt); + fatal("unrecognized file format \"%u\"", fmt); } return AH; @@ -3809,7 +3809,7 @@ ReadHead(ArchiveHandle *AH) fmt = AH->ReadBytePtr(AH); if (AH->format != fmt) - fatal("expected format (%d) differs from format found in file (%d)", + fatal("expected format (%u) differs from format found in file (%d)", AH->format, fmt); } diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 3057665bbe..82fad85773 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -2457,7 +2457,7 @@ evaluateExpr(CState *st, PgBenchExpr *expr, PgBenchValue *retval) default: /* internal error which should never occur */ - pg_log_fatal("unexpected enode type in evaluation: %d", expr->etype); + pg_log_fatal("unexpected enode type in evaluation: %u", expr->etype); exit(1); } } diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index ff673665d8..71dcbc429c 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -379,7 +379,7 @@ AcceptResult(const PGresult *result) default: OK = false; - pg_log_error("unexpected PQresultStatus: %d", + pg_log_error("unexpected PQresultStatus: %u", PQresultStatus(result)); break; } @@ -939,7 +939,7 @@ ProcessResult(PGresult **results) default: /* AcceptResult() should have caught anything else. */ is_copy = false; - pg_log_error("unexpected PQresultStatus: %d", result_status); + pg_log_error("unexpected PQresultStatus: %u", result_status); break; } @@ -1156,7 +1156,7 @@ PrintQueryResults(PGresult *results) default: success = false; - pg_log_error("unexpected PQresultStatus: %d", + pg_log_error("unexpected PQresultStatus: %u", PQresultStatus(results)); break; } @@ -1362,7 +1362,7 @@ SendQuery(const char *query) OK = false; /* PQTRANS_UNKNOWN is expected given a broken connection. */ if (transaction_status != PQTRANS_UNKNOWN || ConnectionUp()) - pg_log_error("unexpected transaction status (%d)", + pg_log_error("unexpected transaction status (%u)", transaction_status); break; } diff --git a/src/fe_utils/print.c b/src/fe_utils/print.c index d542792230..470f5cec50 100644 --- a/src/fe_utils/print.c +++ b/src/fe_utils/print.c @@ -3395,7 +3395,7 @@ printTable(const printTableContent *cont, print_troff_ms_text(cont, fout); break; default: - fprintf(stderr, _("invalid output format (internal error): %d"), + fprintf(stderr, _("invalid output format (internal error): %u"), cont->opt->format); exit(EXIT_FAILURE); } diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index 369c2f0867..909fb0f235 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -410,7 +410,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) return false; } - ecpg_log("ECPGget_desc: TYPE = %d\n", ecpg_dynamic_type_DDT(PQftype(ECPGresult, index))); + ecpg_log("ECPGget_desc: TYPE = %u\n", ecpg_dynamic_type_DDT(PQftype(ECPGresult, index))); break; case ECPGd_cardinality: @@ -466,7 +466,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...) break; default: - snprintf(type_str, sizeof(type_str), "%d", type); + snprintf(type_str, sizeof(type_str), "%u", type); ecpg_raise(lineno, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, type_str); va_end(args); return false; @@ -711,7 +711,7 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) { char type_str[20]; - snprintf(type_str, sizeof(type_str), "%d", itemtype); + snprintf(type_str, sizeof(type_str), "%u", itemtype); ecpg_raise(lineno, ECPG_UNKNOWN_DESCRIPTOR_ITEM, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, type_str); ecpg_free(var); va_end(args); diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 930b6adbe4..6548042e1a 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -297,7 +297,7 @@ ecpg_is_type_an_array(int type, const struct statement *stmt, const struct varia return ECPG_ARRAY_ERROR; ecpg_type_infocache_push(&(stmt->connection->cache_head), type, isarray, stmt->lineno); - ecpg_log("ecpg_is_type_an_array on line %d: type (%d); C (%d); array (%s)\n", stmt->lineno, type, var->type, ECPG_IS_ARRAY(isarray) ? "yes" : "no"); + ecpg_log("ecpg_is_type_an_array on line %d: type (%d); C (%u); array (%s)\n", stmt->lineno, type, var->type, ECPG_IS_ARRAY(isarray) ? "yes" : "no"); return isarray; } diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index a29f530327..9792d44808 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -158,7 +158,7 @@ output_get_descr_header(char *desc_name) if (results->value == ECPGd_count) ECPGnumeric_lvalue(results->variable); else - mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%d\" does not exist", results->value); + mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%u\" does not exist", results->value); } drop_assignments(); @@ -210,7 +210,7 @@ output_set_descr_header(char *desc_name) if (results->value == ECPGd_count) ECPGnumeric_lvalue(results->variable); else - mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%d\" does not exist", results->value); + mmerror(PARSE_ERROR, ET_WARNING, "descriptor header item \"%u\" does not exist", results->value); } drop_assignments(); diff --git a/src/interfaces/ecpg/preproc/ecpg.addons b/src/interfaces/ecpg/preproc/ecpg.addons index 300381eaad..00c61d98d6 100644 --- a/src/interfaces/ecpg/preproc/ecpg.addons +++ b/src/interfaces/ecpg/preproc/ecpg.addons @@ -99,7 +99,7 @@ ECPG: stmtViewStmt rule if (connection) mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CONNECT statement"); - fprintf(base_yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit); + fprintf(base_yyout, "{ ECPGconnect(__LINE__, %u, %s, %d); ", compat, $1, autocommit); reset_variables(); whenever_action(2); free($1); @@ -120,7 +120,7 @@ ECPG: stmtViewStmt rule } | ECPGDescribe { - fprintf(base_yyout, "{ ECPGdescribe(__LINE__, %d, %s,", compat, $1); + fprintf(base_yyout, "{ ECPGdescribe(__LINE__, %u, %s,", compat, $1); dump_variables(argsresult, 1); fputs("ECPGt_EORT);", base_yyout); fprintf(base_yyout, "}"); @@ -144,11 +144,11 @@ ECPG: stmtViewStmt rule const char *con = connection ? connection : "NULL"; if (strcmp($1, "all") == 0) - fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con); + fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %u, %s);", compat, con); else if ($1[0] == ':') - fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1); + fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %u, %s, %s);", compat, con, $1+1); else - fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1); + fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %u, %s, \"%s\");", compat, con, $1); whenever_action(2); free($1); diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c index 65d06d5794..545c4ff017 100644 --- a/src/interfaces/ecpg/preproc/output.c +++ b/src/interfaces/ecpg/preproc/output.c @@ -57,7 +57,7 @@ print_action(struct when *w) fprintf(base_yyout, "continue;"); break; default: - fprintf(base_yyout, "{/* %d not implemented yet */}", w->code); + fprintf(base_yyout, "{/* %u not implemented yet */}", w->code); break; } } @@ -135,7 +135,7 @@ static char *ecpg_statement_type_name[] = { void output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st) { - fprintf(base_yyout, "{ ECPGdo(__LINE__, %d, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks); + fprintf(base_yyout, "{ ECPGdo(__LINE__, %u, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks); if (st == ECPGst_prepnormal && !auto_prepare) st = ECPGst_normal; @@ -191,12 +191,12 @@ output_deallocate_prepare_statement(char *name) if (strcmp(name, "all") != 0) { - fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, ", compat, con); + fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %u, %s, ", compat, con); output_escaped_str(name, true); fputs(");", base_yyout); } else - fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con); + fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %u, %s);", compat, con); whenever_action(2); free(name); diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index d4b4da5ffc..5158bc8d50 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -211,7 +211,7 @@ get_type(enum ECPGttype type) return "ECPGt_string"; break; default: - mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type); + mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %u", type); } return NULL; @@ -682,7 +682,7 @@ ECPGfree_type(struct ECPGtype *type) ECPGfree_struct_member(type->u.members); break; default: - mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type->type); + mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %u", type->type); break; } } @@ -741,7 +741,7 @@ get_dtype(enum ECPGdtype type) case ECPGd_cardinality: return "ECPGd_cardinality"; default: - mmerror(PARSE_ERROR, ET_ERROR, "unrecognized descriptor item code %d", type); + mmerror(PARSE_ERROR, ET_ERROR, "unrecognized descriptor item code %u", type); } return NULL; diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index e7781d010f..2e9381b6de 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -3770,7 +3770,7 @@ PQconnectPoll(PGconn *conn) default: appendPQExpBuffer(&conn->errorMessage, - libpq_gettext("invalid connection state %d, " + libpq_gettext("invalid connection state %u, " "probably indicative of memory corruption\n"), conn->status); goto error_return; diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c index 9360c541be..bfe9603fd4 100644 --- a/src/interfaces/libpq/fe-protocol2.c +++ b/src/interfaces/libpq/fe-protocol2.c @@ -84,7 +84,7 @@ pqSetenvPoll(PGconn *conn) default: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext("invalid setenv state %c, probably indicative of memory corruption\n"), + libpq_gettext("invalid setenv state %u, probably indicative of memory corruption\n"), conn->setenv_state); goto error_return; } @@ -381,7 +381,7 @@ pqSetenvPoll(PGconn *conn) default: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext("invalid state %c, " + libpq_gettext("invalid state %u, " "probably indicative of memory corruption\n"), conn->setenv_state); goto error_return; diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 6df8e14629..aa407ef166 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -1322,7 +1322,7 @@ resolve_column_ref(ParseState *pstate, PLpgSQL_expr *expr, } break; default: - elog(ERROR, "unrecognized plpgsql itemtype: %d", nse->itemtype); + elog(ERROR, "unrecognized plpgsql itemtype: %u", nse->itemtype); } /* Name format doesn't match the plpgsql variable type */ @@ -1420,7 +1420,7 @@ plpgsql_parse_word(char *word1, const char *yytxt, bool lookup, default: /* plpgsql_ns_lookup should never return anything else */ - elog(ERROR, "unrecognized plpgsql itemtype: %d", + elog(ERROR, "unrecognized plpgsql itemtype: %u", ns->itemtype); } } @@ -1912,7 +1912,7 @@ plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype, result = NULL; /* keep compiler quiet */ break; default: - elog(ERROR, "unrecognized ttype: %d", dtype->ttype); + elog(ERROR, "unrecognized ttype: %u", dtype->ttype); result = NULL; /* keep compiler quiet */ break; } @@ -1992,7 +1992,7 @@ build_row_from_vars(PLpgSQL_variable **vars, int numvars) break; default: - elog(ERROR, "unrecognized dtype: %d", var->dtype); + elog(ERROR, "unrecognized dtype: %u", var->dtype); typoid = InvalidOid; /* keep compiler quiet */ typmod = 0; typcoll = InvalidOid; diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index ccbc50fc45..06949e98f5 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -582,7 +582,7 @@ plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo, default: /* Anything else should not be an argument variable */ - elog(ERROR, "unrecognized dtype: %d", func->datums[i]->dtype); + elog(ERROR, "unrecognized dtype: %u", func->datums[i]->dtype); } } @@ -1322,7 +1322,7 @@ copy_plpgsql_datums(PLpgSQL_execstate *estate, break; default: - elog(ERROR, "unrecognized dtype: %d", indatum->dtype); + elog(ERROR, "unrecognized dtype: %u", indatum->dtype); outdatum = NULL; /* keep compiler quiet */ break; } @@ -1487,7 +1487,7 @@ plpgsql_fulfill_promise(PLpgSQL_execstate *estate, break; default: - elog(ERROR, "unrecognized promise type: %d", var->promise); + elog(ERROR, "unrecognized promise type: %u", var->promise); } MemoryContextSwitchTo(oldcontext); @@ -1709,7 +1709,7 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block) break; default: - elog(ERROR, "unrecognized dtype: %d", datum->dtype); + elog(ERROR, "unrecognized dtype: %u", datum->dtype); } } @@ -2090,7 +2090,7 @@ exec_stmts(PLpgSQL_execstate *estate, List *stmts) default: /* point err_stmt to parent, since this one seems corrupt */ estate->err_stmt = save_estmt; - elog(ERROR, "unrecognized cmd_type: %d", stmt->cmd_type); + elog(ERROR, "unrecognized cmd_type: %u", stmt->cmd_type); rc = -1; /* keep compiler quiet */ } @@ -2525,7 +2525,7 @@ exec_stmt_getdiag(PLpgSQL_execstate *estate, PLpgSQL_stmt_getdiag *stmt) break; default: - elog(ERROR, "unrecognized diagnostic item kind: %d", + elog(ERROR, "unrecognized diagnostic item kind: %u", diag_item->kind); } } @@ -3301,7 +3301,7 @@ exec_stmt_return(PLpgSQL_execstate *estate, PLpgSQL_stmt_return *stmt) break; default: - elog(ERROR, "unrecognized dtype: %d", retvar->dtype); + elog(ERROR, "unrecognized dtype: %u", retvar->dtype); } return PLPGSQL_RC_RETURN; @@ -3470,7 +3470,7 @@ exec_stmt_return_next(PLpgSQL_execstate *estate, break; default: - elog(ERROR, "unrecognized dtype: %d", retvar->dtype); + elog(ERROR, "unrecognized dtype: %u", retvar->dtype); break; } } @@ -3898,7 +3898,7 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt) SET_RAISE_OPTION_TEXT(err_schema, "SCHEMA"); break; default: - elog(ERROR, "unrecognized raise option: %d", opt->opt_type); + elog(ERROR, "unrecognized raise option: %u", opt->opt_type); } exec_eval_cleanup(estate); @@ -5480,7 +5480,7 @@ exec_assign_value(PLpgSQL_execstate *estate, } default: - elog(ERROR, "unrecognized dtype: %d", target->dtype); + elog(ERROR, "unrecognized dtype: %u", target->dtype); } } @@ -5642,7 +5642,7 @@ exec_eval_datum(PLpgSQL_execstate *estate, } default: - elog(ERROR, "unrecognized dtype: %d", datum->dtype); + elog(ERROR, "unrecognized dtype: %u", datum->dtype); } } @@ -5722,7 +5722,7 @@ plpgsql_exec_get_datum_type(PLpgSQL_execstate *estate, } default: - elog(ERROR, "unrecognized dtype: %d", datum->dtype); + elog(ERROR, "unrecognized dtype: %u", datum->dtype); typeid = InvalidOid; /* keep compiler quiet */ break; } @@ -5815,7 +5815,7 @@ plpgsql_exec_get_datum_type_info(PLpgSQL_execstate *estate, } default: - elog(ERROR, "unrecognized dtype: %d", datum->dtype); + elog(ERROR, "unrecognized dtype: %u", datum->dtype); *typeId = InvalidOid; /* keep compiler quiet */ *typMod = -1; *collation = InvalidOid; @@ -7442,7 +7442,7 @@ exec_move_row_from_fields(PLpgSQL_execstate *estate, return; } - elog(ERROR, "unsupported target type: %d", target->dtype); + elog(ERROR, "unsupported target type: %u", target->dtype); } /* diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c index ee60ced583..0b2e0efd5f 100644 --- a/src/pl/plpgsql/src/pl_funcs.c +++ b/src/pl/plpgsql/src/pl_funcs.c @@ -464,7 +464,7 @@ free_stmt(PLpgSQL_stmt *stmt) free_set((PLpgSQL_stmt_set *) stmt); break; default: - elog(ERROR, "unrecognized cmd_type: %d", stmt->cmd_type); + elog(ERROR, "unrecognized cmd_type: %u", stmt->cmd_type); break; } } @@ -772,7 +772,7 @@ plpgsql_free_function_memory(PLpgSQL_function *func) free_expr(((PLpgSQL_arrayelem *) d)->subscript); break; default: - elog(ERROR, "unrecognized data type: %d", d->dtype); + elog(ERROR, "unrecognized data type: %u", d->dtype); } } func->ndatums = 0; @@ -932,7 +932,7 @@ dump_stmt(PLpgSQL_stmt *stmt) dump_set((PLpgSQL_stmt_set *) stmt); break; default: - elog(ERROR, "unrecognized cmd_type: %d", stmt->cmd_type); + elog(ERROR, "unrecognized cmd_type: %u", stmt->cmd_type); break; } } @@ -1273,7 +1273,7 @@ dump_cursor_direction(PLpgSQL_stmt_fetch *stmt) printf(" RELATIVE "); break; default: - printf("??? unknown cursor direction %d", stmt->direction); + printf("??? unknown cursor direction %u", stmt->direction); } if (stmt->expr) @@ -1711,7 +1711,7 @@ plpgsql_dumptree(PLpgSQL_function *func) printf("\n"); break; default: - printf("??? unknown data type %d\n", d->dtype); + printf("??? unknown data type %u\n", d->dtype); } } printf("\nFunction's statements:\n"); diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index 8227bf0449..760619ca2f 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -1016,7 +1016,7 @@ stmt_getdiag : K_GET getdiag_area_opt K_DIAGNOSTICS getdiag_list ';' case PLPGSQL_GETDIAG_CONTEXT: break; default: - elog(ERROR, "unrecognized diagnostic item kind: %d", + elog(ERROR, "unrecognized diagnostic item kind: %u", ditem->kind); break; } @@ -3446,7 +3446,7 @@ check_assignable(PLpgSQL_datum *datum, int location) location); break; default: - elog(ERROR, "unrecognized dtype: %d", datum->dtype); + elog(ERROR, "unrecognized dtype: %u", datum->dtype); break; } } -- 2.29.1