Re: pgsql: Improve PQtrace() output format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Improve PQtrace() output format
Date: 2021-04-06 04:56:16
Message-ID: 947584.1617684976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

David Rowley <dgrowleyml(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2021-04-06 05:10:25 pgsql: Fix typo in pgstat.c.
Previous Message Fujii Masao 2021-04-06 04:45:01 pgsql: Add function to log the memory contexts of specified backend pro