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

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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql(at)mohawksoft(dot)com, Nicolai Tufar <ntufar(at)gmail(dot)com>,Magnus Hagander <mha(at)sollentuna(dot)net>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Date: 2005-03-11 16:18:07
Message-ID: 200503111618.j2BGI7503258@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Tom Lane wrote:
> pgsql(at)mohawksoft(dot)com writes:
> >>> Please see my posting about using a macro for snprintf.
> 
> > Wasn't the issue about odd behavior of the Win32 linker choosing the wrong
> > vnsprintf?
> 
> You're right, the point about the macro was to avoid linker weirdness on
> Windows.  We need to do that part in any case.  I think Bruce confused
> that issue with the one about whether our version supported %n$
> adequately ... which it doesn't just yet ...

Perhaps I am reading old email in this reply but I thought I should
clarify:

Once we do:
	
	#define vsnprintf(...)        pg_vsnprintf(__VA_ARGS__)
	#define snprintf(...)         pg_snprintf(__VA_ARGS__)
	#define printf(...)           pg_printf(__VA_ARGS__)

we also rename the functions in snprintf.c to pg_* names so there is no
longer a conflict with the system libc versions.

The macro is to prevent our snprintf from leaking out of libraries like
libpq, not to fix the win32 linker problem, which we already had fixed
by reordering the entries in the C file.

Perhaps the macro idea originally came as a fix for Win32 but it is much
larger that that now.

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

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-03-11 16:21:23
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Previous:From: Bruce MomjianDate: 2005-03-11 15:36:07
Subject: Re: postgreSQL-8.0.1 configure --enable-thread-safety with

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-03-11 16:21:23
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Previous:From: Marko KreenDate: 2005-03-11 15:48:30
Subject: pgcrypto: openssl digest fix

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2005-03-11 16:21:23
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Previous:From: Nicolai TufarDate: 2005-03-11 06:41:39
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

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