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 1mjltD-0001ic-N3 for pgsql-committers@arkaria.postgresql.org; Sun, 07 Nov 2021 17:23:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mjltC-00040x-6u for pgsql-committers@arkaria.postgresql.org; Sun, 07 Nov 2021 17:23:30 +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 1mjltC-00040n-03 for pgsql-committers@lists.postgresql.org; Sun, 07 Nov 2021 17:23:30 +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 1mjlt9-0006kY-8f for pgsql-committers@lists.postgresql.org; Sun, 07 Nov 2021 17:23:29 +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 1A7HNPHX757857; Sun, 7 Nov 2021 12:23:25 -0500 From: Tom Lane To: Michael Paquier cc: Robert Haas , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Change ThisTimeLineID from a global variable to a local variable In-reply-to: References: Comments: In-reply-to Michael Paquier message dated "Sat, 06 Nov 2021 09:17:33 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <757855.1636305805.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 07 Nov 2021 12:23:25 -0500 Message-ID: <757856.1636305805@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Fri, Nov 05, 2021 at 04:55:52PM +0000, Robert Haas wrote: >> Change ThisTimeLineID from a global variable to a local variable. > lapwing looks unhappy after this commit: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dlapwing&dt=3D2= 021-11-05%2022%3A40%3A10 > xlog.c: In function 'StartupXLOG': > xlog.c:7249:5: error: 'checkPointLoc' may be used uninitialized in > this function [-Werror=3Dmaybe-uninitialized] > xlog.c:6686:5: note: 'checkPointLoc' was declared here Yeah. I've seen some older compilers complain about that code before, but now there are over a dozen buildfarm members warning about it. It's clearly a false positive, since checkPointLoc does get set in the read_backup_label()-failure-return code path. I think we've seen a few other places where likely-to-be-inlined functions have to initialize their result variables to prevent compiler warnings, so I stuck an initialization step into read_backup_label in hopes of silencing it. regards, tom lane