Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] %2$, %1$ gettext placeholder replacement is not working under Win32

From: Nicolai Tufar <ntufar(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org,pgsql-hackers-win32(at)postgresql(dot)org,Ismail Teppeev <iteppeev(at)gmail(dot)com>
Subject: Re: [HACKERS] %2$, %1$ gettext placeholder replacement is not working under Win32
Date: 2005-01-22 20:19:20
Message-ID: d80929390501221219324de7a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
On Sat, 22 Jan 2005 15:31:39 +0100, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Nicolai Tufar wrote:
> > 1. I renamed snprintf() to pg_snprintf(), vsnprintf() to
> > pg_vsnprintf() and introduced pg_printf() that calls pg_vsnprintf().
> 
> This is not necessary.  You will notice that we already have configure
> tests of snprintf format specifiers (%lld etc.), so using the original
> function names is OK even in that case.

how about a test for the thing like: 
printf("%2$s %1$s!\n", "world", "Hello");
It is what I am trying to solve :(

> > 5. Before running regression test I always ran make install,
> > apparently because libpq is read from /usr/local/.
> 
> That's because of the -rpath.

I see. Thanks for information.

> 
> > 2. Why would we not just take FreeBSD's vfprintf() and use it
> > instead?
> 
> Try it.  It's painful.

src/port/snprintf.c is not not a particularly pretty. And
after my rework it got even uglier. I have looked at 
FreeBDS's one and it is not *that* complicated. Would
you like me to try to incorporate into PostgreSQL.
NetBSD's one is somewhat simplier but does not 
support %n$ feature by the way.

> > 4. What %m format string is used for? And where is it handled. Do I
> > need to implement it?
> 
> It's only used in the error reporting functions in the server and is
> handled there.  You don't need to worry about it.

Oh, that is a relief.

> Peter Eisentraut
Nicolai

In response to

Responses

pgsql-hackers by date

Next:From: Euler Taveira de OliveiraDate: 2005-01-22 20:36:27
Subject: Re: [PATCHES] Merge pg_shadow && pg_group -- UNTESTED
Previous:From: Bruce MomjianDate: 2005-01-22 20:06:33
Subject: Re: Much Ado About COUNT(*)

pgsql-hackers-win32 by date

Next:From: Edin KadribasicDate: 2005-01-22 21:07:13
Subject: Include files for static VC libpq.lib
Previous:From: Peter EisentrautDate: 2005-01-22 14:31:39
Subject: Re: [HACKERS] %2$, %1$ gettext placeholder replacement is not working under Win32

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group