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 1jk8qu-0003Fz-Iu for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2020 16:17:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jk8qt-0000En-A7 for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2020 16:17:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jk8qt-0000Eg-3H for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2020 16:17:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jk8ql-0007S3-U5 for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2020 16:17:49 +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 05DGHeQa841650; Sat, 13 Jun 2020 12:17:41 -0400 From: Tom Lane To: Peter Geoghegan cc: pgsql-hackers@lists.postgresql.org Subject: Uninitialized-variable warnings in nbtinsert.c MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <841648.1592065060.1@sss.pgh.pa.us> Date: Sat, 13 Jun 2020 12:17:40 -0400 Message-ID: <841649.1592065060@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I scraped the buildfarm's compiler warnings today, as I do from time to time, and I noticed that half a dozen animals that normally don't report any uninitialized-variable warnings are complaining about "curitup" in _bt_doinsert. We traditionally ignore such warnings from compilers that have demonstrated track records of being stupid about it, but when a reasonably modern compiler shows such a warning I think we ought to suppress it. Right now the counts of uninitialized-variable warnings in HEAD builds are 1 calliphoridae 1 chipmunk 1 coypu 1 culicidae 2 curculio 1 frogfish 25 locust 24 prairiedog (curculio is additionally whining about "curitemid" in the same function.) So you can see that this one issue has greatly expanded the set of compilers that are unhappy. I can see their point too -- it requires some study to be sure we are assigning curitup before dereferencing it. The simplest fix would be to just initialize curitup to NULL in its declaration. But perhaps there's a better way. regards, tom lane