pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Allowing printf("%m") only where it actually works
Date: Mon, 28 May 2018 11:01:25 -0400
Message-ID: <20180528150125.j2x3mp62ssbeg3h5@alvherre.pgsql> (raw)
In-Reply-To: <CAEepm=1YLObd0aX9K4jqOHwQF3LQzSJB1VCNd-GstZhN67Q4CA@mail.gmail.com>

On 2018-May-27, Thomas Munro wrote:

> Out of curiosity I tried adding a GetLastError variable for Windows
> (to hide the function of that name and break callers) to the earlier
> experimental patch (attached).  I had to give it an initial value to
> get rid of a warning about an unused variable (by my reading of the
> documentation, __pragma(warning(suppress:4101)) can be used in macros
> (unlike #pragma) and should shut that warning up, but it doesn't work
> for me, not sure why).  Of course that produces many errors since we
> do that all over the place:
> 
> https://ci.appveyor.com/project/macdice/postgres/build/1.0.184

Ouch.

This seems to say that we oughta assign GetLastError() to saved_errno
during errstart, then use %m in the errmsg() instead.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (50+ messages)  latest in thread

Message-ID: <20180528150125.j2x3mp62ssbeg3h5@alvherre.pgsql>
Permalink:  ../20180528150125.j2x3mp62ssbeg3h5@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180528150125.j2x3mp62ssbeg3h5@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, thomas.munro@enterprisedb.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: Allowing printf("%m") only where it actually works
  In-Reply-To: <20180528150125.j2x3mp62ssbeg3h5@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox