Various buildfarm members are complaining about this patch, eg
caiman | 2021-02-12 15:00:19 | tablesync.c:885:70: warning: argument 3 of type 'char[64]' with mismatched bound
[-Warray-parameter=]
caiman | 2021-02-12 15:00:19 | tablesync.c:904:72: warning: argument 3 of type 'char[64]' with mismatched bound
[-Warray-parameter=]
That's because of the inconsistency between
extern void ReplicationOriginNameForTablesync(Oid suboid, Oid relid, char *originname);
and
void
ReplicationOriginNameForTablesync(Oid suboid, Oid relid,
char originname[NAMEDATALEN])
Don't do that. Quite aside from the inconsistency, this is pretty
darn unsafe coding technique, because there is exactly nothing
guaranteeing that the caller passes a buffer of the length the
function expects.
I'm not real sure that you could expect a compiler warning for that
even if you'd put the length declaration where callers could see it.
So personally I'd avoid hard-wiring NAMEDATALEN into this API at all,
and have the caller pass sizeof(its buffer) instead.
regards, tom lane