snprintf improvements

Started by Bruce Momjianover 21 years ago6 messagespatches
Jump to latest
#1Bruce Momjian
bruce@momjian.us

This patch uses our own snprintf() only when NLS support is enabled, and
I added support for %qd and %I64d in snprintf. We might need those in
the final version if it is exported to apps.

-- 
  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, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+23-6
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#1)
Re: snprintf improvements

Am Mittwoch, 2. Mᅵrz 2005 15:48 schrieb Bruce Momjian:

This patch uses our own snprintf() only when NLS support is enabled, and
I added support for %qd and %I64d in snprintf. We might need those in
the final version if it is exported to apps.

test -a is not portable.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#3Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#2)
Re: snprintf improvements

Peter Eisentraut wrote:

Am Mittwoch, 2. M?rz 2005 15:48 schrieb Bruce Momjian:

This patch uses our own snprintf() only when NLS support is enabled, and
I added support for %qd and %I64d in snprintf. We might need those in
the final version if it is exported to apps.

test -a is not portable.

Thanks, fixed:

if test "$enable_nls" = yes && test $pgac_need_repl_snprintf = no; then

-- 
  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, Pennsylvania 19073
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: snprintf improvements

Bruce Momjian <pgman@candle.pha.pa.us> writes:

This patch uses our own snprintf() only when NLS support is enabled,

I see no point in this; it does not solve any problem we need solved,
only complicate the configuration behavior even more.

I added support for %qd and %I64d in snprintf.

I consider this an awful idea as well.

regards, tom lane

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#4)
Re: snprintf improvements

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

This patch uses our own snprintf() only when NLS support is
enabled,

I see no point in this; it does not solve any problem we need solved,
only complicate the configuration behavior even more.

I think this is analogous to checking for snprintf() support of 64-bit
integers only if we previously found 64-bit integers to be supported.
We don't need to include our own snprintf() if we don't need the extra
features it provides.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: snprintf improvements

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

This patch uses our own snprintf() only when NLS support is enabled,

I see no point in this; it does not solve any problem we need solved,
only complicate the configuration behavior even more.

Peter answered this.

I added support for %qd and %I64d in snprintf.

I consider this an awful idea as well.

Moved into a NOT_USED block so we can keep it in case we want it later.

-- 
  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, Pennsylvania 19073