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 1lTdlI-00051G-CT for pgsql-committers@arkaria.postgresql.org; Tue, 06 Apr 2021 04:56:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTdlH-0004jE-1T for pgsql-committers@arkaria.postgresql.org; Tue, 06 Apr 2021 04:56:23 +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 1lTdlG-0004j7-Sk for pgsql-committers@lists.postgresql.org; Tue, 06 Apr 2021 04:56:22 +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 1lTdlE-0003Hj-EG for pgsql-committers@lists.postgresql.org; Tue, 06 Apr 2021 04:56:21 +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 1364uGaA947585; Tue, 6 Apr 2021 00:56:17 -0400 From: Tom Lane To: David Rowley cc: Alvaro Herrera , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Improve PQtrace() output format In-reply-to: References: Comments: In-reply-to David Rowley message dated "Tue, 06 Apr 2021 16:38:04 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <947583.1617684976.1@sss.pgh.pa.us> Date: Tue, 06 Apr 2021 00:56:16 -0400 Message-ID: <947584.1617684976@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I see the Visual Studio buildfarm members have been getting a compiler > warning since this commit [1] > (ClCompile target) -> > src/interfaces/libpq/fe-trace.c(87): warning C4133: 'function': > incompatible types - from 'long *' to 'const time_t *const ' > [C:\\pgbuildfarm\\pgbuildroot\\HEAD\\pgsql.build\\libpq.vcxproj] The current form of it is my fault, I think, see f1be740a9. Alvaro's commit had different issues ;-( > It looks like this is due to long being 32-bits on Visual Studio. As best I can tell from these warnings, VS has the tv_sec field of struct timeval defined as something other than time_t. Because VS would never stoop to actually complying with the plain text of the POSIX standard. > We could just assign tval.tv_sec to a local time_t value to get rid of > it. See attached. Yeah, I've not got a better idea. But please add some comment about how this is working around VS brain-damage, because anyone looking at the available standards documents would think the copying is unnecessary. regards, tom lane