Re: patch: garbage error strings in libpq - Mailing list pgsql-patches

From Tom Lane
Subject Re: patch: garbage error strings in libpq
Date
Msg-id 25975.1120659771@sss.pgh.pa.us
Whole thread Raw
In response to Re: patch: garbage error strings in libpq  (Neil Conway <neilc@samurai.com>)
Responses Re: patch: garbage error strings in libpq
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> I think you're missing the point. Obviously the current code is wrong,
> the debate is over the best way to fix it. Jeroen's interpretation of
> the spec suggests that merely having libpq_gettext() preserve errno is
> not sufficient. I'm not convinced this his interpretation is correct,
> but it is a question worth resolving.

(1) The fact that gettext works at all seems to me to be sufficient
empirical evidence that it's a working solution.  (2) Whether there are
sequence points in the function call or not, there most certainly are
sequence points inside each called function.  The spec allows the
functions involved to be called in an unspecified order, but it doesn't
allow the compiler to interleave the execution of several functions.
(3) Interpretation or not, the approach that Jeroen proposes is
unmaintainable; people will not remember to use such a kluge everywhere
they'd need to.  I'd much rather fix it in one place and do whatever we
have to do to keep the compiler from breaking that one place.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: patch: garbage error strings in libpq
Next
From: Bruce Momjian
Date:
Subject: Re: Disable page writes when fsync off, add GUC