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 1jk8Vr-0002Wx-8u for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2020 15:56:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jk8Vq-00086D-4L for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jun 2020 15:56:06 +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 1jk8Vp-000866-Tg for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2020 15:56:05 +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 1jk8Vn-0007I1-C0 for pgsql-hackers@lists.postgresql.org; Sat, 13 Jun 2020 15:56:05 +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 05DFu0Yt831664; Sat, 13 Jun 2020 11:56:00 -0400 From: Tom Lane To: Dean Rasheed cc: PostgreSQL Hackers Subject: Re: Definitional issue: stddev_pop (and related) for 1 input In-reply-to: References: <353062.1591898766@sss.pgh.pa.us> <780404.1591991618@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sat, 13 Jun 2020 11:06:12 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <831662.1592063760.1@sss.pgh.pa.us> Date: Sat, 13 Jun 2020 11:56:00 -0400 Message-ID: <831663.1592063760@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dean Rasheed writes: > The patch looks reasonable, except I wonder if all compilers are smart > enough to realise that totCount is always initialised. I think they should be, since that if-block ends with a return; the only way to get to the use of totCount is for both parts of the first if-condition to be executed. In any case, we do have an effective policy of ignoring uninitialized-variable warnings from very old/stupid compilers. locust and prairiedog, which I think use the same ancient gcc version, emit a couple dozen such warnings. If they are the only ones that complain about this new code, I'll not worry. Thanks for looking at the patch! regards, tom lane