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

Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

From: Nicolai Tufar <ntufar(at)gmail(dot)com>
To: "pgsql(at)mohawksoft(dot)com" <pgsql(at)mohawksoft(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org,pgsql-hackers-win32(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail
Date: 2005-03-01 20:57:28
Message-ID: d8092939050301125722d9078f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
On Tue, 1 Mar 2005 15:38:58 -0500 (EST), pgsql(at)mohawksoft(dot)com
<pgsql(at)mohawksoft(dot)com> wrote:
> Is there a reason why we don't use the snprintf that comes with the
> various C compilers?

snprintf() is usually buried in OS libraries. We implement
our own snprintf to make things like this:
snprintf(buf,"%2$s %1$s","world","Hello"); 
which is not supported on some platforms work.

We do it for national language translation of
messages. In some languages you may need
to change order of parameters to make a meaningful
sentence.

Another question is why we are using it for printing
values from database. I am not too good on function
overriding in standard C but maybe there is a way
to usage of standard snprintf() in a particular place.

In response to

Responses

pgsql-hackers by date

Next:From: pgsqlDate: 2005-03-01 21:20:50
Subject: Re: [pgsql-hackers-win32] snprintf causes regression
Previous:From: Magnus HaganderDate: 2005-03-01 20:44:56
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

pgsql-hackers-win32 by date

Next:From: pgsqlDate: 2005-03-01 21:20:50
Subject: Re: [pgsql-hackers-win32] snprintf causes regression
Previous:From: Magnus HaganderDate: 2005-03-01 20:44:56
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

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