Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAhGT-0005iE-FH for pgsql-committers@arkaria.postgresql.org; Fri, 12 Feb 2021 22:50:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAhGR-0002qG-08 for pgsql-committers@arkaria.postgresql.org; Fri, 12 Feb 2021 22:50:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAhGQ-0002q9-R9 for pgsql-committers@lists.postgresql.org; Fri, 12 Feb 2021 22:50:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAhGL-0002sv-IU; Fri, 12 Feb 2021 22:50:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11CMo7lV1610790; Fri, 12 Feb 2021 17:50:07 -0500 From: Tom Lane To: Amit Kapila cc: Amit Kapila , pgsql-committers Subject: Re: pgsql: Allow multiple xacts during table sync in logical replication. In-reply-to: References: <1519064.1613099867@sss.pgh.pa.us> Comments: In-reply-to Amit Kapila message dated "Fri, 12 Feb 2021 10:51:47 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1610788.1613170207.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Feb 2021 17:50:07 -0500 Message-ID: <1610789.1613170207@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Various buildfarm members are complaining about this patch, eg caiman | 2021-02-12 15:00:19 | tablesync.c:885:70: warning: argume= nt 3 of type 'char[64]' with mismatched bound [-Warray-parameter=3D] caiman | 2021-02-12 15:00:19 | tablesync.c:904:72: warning: argume= nt 3 of type 'char[64]' with mismatched bound [-Warray-parameter=3D] 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