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

Re: [HACKERS] snprintf causes regression tests to fail

From: Joerg Hessdoerfer <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>,pgsql-hackers-win32(at)postgresql(dot)org, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"Nicolai Tufar" <ntufar(at)gmail(dot)com>
Subject: Re: [HACKERS] snprintf causes regression tests to fail
Date: 2005-03-01 21:42:52
Message-ID: 200503012242.52631.Joerg.Hessdoerfer@sea-gmbh.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
Hi,

On Tuesday 01 March 2005 21:44, you wrote:
> >> I spent all day debugging it. Still have absolutely
> >> no idea what could possibly go wrong. Does
> >> anyone have a slightest clue what can it be and
> >> why it manifests itself only on win32?
> >
> >It may be that the CLIB  has badly broken support for 64bit
> >integers on 32
> >bit platforms. Does anyone know of any Cygwin/Ming issues?
> >
> >Is this only with the new snprintf code in Win32?
>
> Yes.
>
> >Is this a problem with snprintf as implemented in src/port?
>
> Yes. Only. It works with the snprintf() in the runtime (this particular
> part).
>
> >Is there a reason why we don't use the snprintf that comes with the
> >various C compilers?
>
> It does not support "positional parameters" (I think it's called) which
> is required for proper translations.
> We do use that one when it works...
>
> //Magnus

Some stupid idea just crossed my mind: what if the /ports version just 
re-arranges the va_list according to the positional args and calls 
vsnprintf()?
At least we know compiler and library...

Or, another idea: why not format the va_args individually using the original 
format specifiers alone (without positional args), and assemble the resulting 
string?

Am I on dope? Or does this sound at least doable?

Didn't code too much C lately...

Greetings,
 Jörg
-- 
Leading SW developer  - S.E.A GmbH
Mail: joerg(dot)hessdoerfer(at)sea-gmbh(dot)com
WWW:  http://www.sea-gmbh.com

In response to

Responses

pgsql-hackers by date

Next:From: Mark WongDate: 2005-03-01 21:51:16
Subject: Re: 8.0.X and the ARC patent
Previous:From: Tom LaneDate: 2005-03-01 21:22:28
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

pgsql-hackers-win32 by date

Next:From: Nicolai TufarDate: 2005-03-01 21:59:10
Subject: Re: [HACKERS] snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-01 21:22:28
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

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