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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [PATCHES] snprintf() argument reordering not working
Дата
Msg-id 200512050521.jB55LfE07355@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [PATCHES] snprintf() argument reordering not working  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: [PATCHES] snprintf() argument reordering not working  ("Andrew Dunstan" <andrew@dunslane.net>)
Список pgsql-hackers
OK, a few things.  First, Tom has fixed snprintf.c so it should properly
process positional parameters now.  Would you first test the libintl
version of *printf to see if it can process %$ parameters (probably by
hacking up any language file and testing the printing), and then try
your patch below to see if it is properly reorders the arguments.  If
libintl does not reorder properly, but our snprintf.c does, would you
please generate an appliable patch we can put into 8.1.X?  Thanks.

I know I am asking a lot, but you are "the man" on this one.  :-)

---------------------------------------------------------------------------

Andrew Dunstan wrote:
> 
> 
> Bruce Momjian wrote:
> 
> >Tom Lane wrote:
> >  
> >
> >>Andrew Dunstan <andrew@dunslane.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
> 
> 


> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gavin Sherry
Дата:
Сообщение: Re: Upcoming PG re-releases
Следующее
От: Kevin Brown
Дата:
Сообщение: Re: Reducing relation locking overhead