Re: libpq error message refactoring

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq error message refactoring
Date: 2022-09-23 02:37:29
Message-ID: 2032645.1663900649@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> On 22.09.22 17:42, Andres Freund wrote:
>> It's not the cause of this failure, I think, but doesn't appendPQExpBufferVA
>> need to be added to exports.txt?

> I don't want to make that function available to users of libpq, just use
> it inside libpq across .c files. Is there no visibility level for that?

Should "just work", I should think. I agree with Andres that that's
not the cause of the build failure. I wonder if somehow the failing
links are picking up the wrong libpq.a.

Separately from that: is it really okay to delegate use of a va_list
argument like that? The other call paths of
appendPQExpBufferVA[_internal] write va_start/va_end directly around it,
not somewhere else in the call chain. I'm too tired to language-lawyer
out what happens when you do it like this, but I'm suspecting that it's
not well-defined portable behavior.

I think what you probably need to do is export appendPQExpBufferVA
as-is and require libpq_append_error to provide the error loop.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-23 02:40:47 Re: libpq error message refactoring
Previous Message Andres Freund 2022-09-23 02:27:27 Re: libpq error message refactoring