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

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: 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 16:09:48
Message-ID: 439314CC.6090400@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches

Bruce Momjian wrote:

>OK, here is what happened.  In March 2005, we got reports of compile
>problems on Win32 using NLS:
>
>	http://archives.postgresql.org/pgsql-hackers/2005-03/msg00710.php
>
>(See the quoted text under the posted text as well.)  Basically,
>libintl.h on Win32 replaces *printf calls with its own versions, and
>does it using macros, _just_ like we do.  This of course causes
>conflicts and the system fails to compile.  The _fix_ was to disable
>port/*printf on Win32 when using NLS because NLS wants to use its own
>*printf.  I _assumed_ that libintl.h did this so it could use its own
>routines that understood %$, but never verified that.  It didn't seem we
>had any choice to fix this, and got no problem reports about %$ not
>working until yours.
>
>After over a month with no solution I added the code as you see it now:
>
>	http://archives.postgresql.org/pgsql-hackers-win32/2005-05/msg00011.php
>
>Oh, and it was Andrew Dunstan who worked on this, not Magnus.  (Sorry
>Magnus, Hello Andrew.)
>
>Anyway, I think the big question is, was the pginstaller built with a
>libintl that replaces *printf, and is it an *printf that doesn't
>understand positional parameters, and so, how can we fix it.
>
>  
>

Well , I diagnosed the problem - you're on your own as far as the 
"solution" goes ;-)

On thing that seems clear to me is that we need a way of testing NLS 
support.

Tom said:

>Would it work to modify c.h so that it #include's libintl.h, then #undefs
>these macros, then #includes port.h to define 'em the way we want?
>Some or all of this might need to be #ifdef WIN32, but that seems like
>a reasonably noninvasive solution if it can work.
>

IIRC last time I tried this it didn't work too well ;-( I will have 
another go. I think it's the best way to go.

cheers

andrew

In response to

Responses

pgsql-hackers by date

Next:From: Paul LindnerDate: 2005-12-04 16:25:20
Subject: Re: Upcoming PG re-releases
Previous:From: Paul LindnerDate: 2005-12-04 15:57:15
Subject: MIN() performance regression 8.0 -> 8.1

pgsql-patches by date

Next:From: Andrew DunstanDate: 2005-12-04 18:53:06
Subject: Re: [PATCHES] snprintf() argument reordering not working
Previous:From: Bruce MomjianDate: 2005-12-04 04:10:18
Subject: Re: return can contains any row or record functions

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