Re: [PATCHES] snprintf() argument reordering not working

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nicolai Tufar <ntufar(at)gmail(dot)com>, devrim(at)kivi(dot)com(dot)tr, Magnus Hagander <mha(at)sollentuna(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] snprintf() argument reordering not working
Date: 2005-12-04 23:08:09
Message-ID: 439376D9.9080708@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>
>>
>>>That got me through the backend compile and through libpq to ecpg, which
>>>fell over at the link stage complaining about missing references to
>>>pg_sprintf and pg_snprintf ... not sure how to fix that - windows
>>>experts, please advise.
>>>
>>>
>>Plan A would be to make libpq export pg_snprintf and friends, Plan B
>>would be to give ecpg its own copy of snprintf.o. Plan A is probably
>>better since you're going to hit the same issue no doubt in all of the
>>src/bin programs.
>>
>>
>
>I am confused why we would need either of these. All apps use
>libpgport, and that pg_*printf should be in that library. The original
>work Andrew did has problems particularly with ecpg, but why does ecpg
>cause problems? Doesn't it link in pgport?
>
>
>

libpgtypes doesn't link with either libpgport or libpq.

What I have done to get a working build in addition to the previous
report is to undef snprintf and sprintf in
interfaces/pgtypeslib/extern.h (instead of creating an additional link
burden), and to add entries for pg_snprintf, pg_sprintf and pg_fprintf
to interfaces/libpq/exports.txt. That let me get a clean compile and
regression run. The diff against 8.1 is attached for comment.

I suspect we should probably add all the pg_*printf functions to
exports.txt.

(Of course, first you need to install gettext and libintl from the
gnuwin32 project, or you can't even configure with --enable-nls)

cheers

andrew

Attachment Content-Type Size
nls.diff text/x-patch 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-12-04 23:22:54 Re: SERIAL type feature request
Previous Message Tino Wildenhain 2005-12-04 22:25:08 Re: SERIAL type feature request

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-12-05 02:50:15 port/snprintf.c (was Re: Numeric 508 datatype)
Previous Message Bruce Momjian 2005-12-04 22:09:42 Re: [PATCHES] snprintf() argument reordering not working