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

Re: snprintf causes regression tests to fail

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nicolai Tufar <ntufar(at)gmail(dot)com>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>,pgsql-hackers(at)postgresql(dot)org, pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: snprintf causes regression tests to fail
Date: 2005-03-02 01:55:11
Message-ID: 200503020155.j221tBU28123@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
I have some new information.  If I add the attached patch to snprintf.c,
I should see see snprintf() being called printing "0", vsnprintf()
printing "1" and dopr(), "2".  However, I only see "0" printing in the
server logs.

I think this means it is finding our /port/snprintf(), but when it calls
vsnprintf, it must be using some other version, probably the operating
system version that doesn't support %lld.

I am also attaching the 'nm' output from libpgport_srv.a which does show
vsnprintf as being defined.

Win32 doesn't like multiply defined symbols so we use
-Wl,--allow-multiple-definition to allow multiple symbols.

I bet if I define LONG_LONG_INT_FORMAT as '%I64d' it would pass the
regression tests.  (I will test now.)  Our config/c-library.m4 file
confirms that format for MinGW:

	# MinGW uses '%I64d', though gcc throws an warning with -Wall,

The big question is why our own vsnprintf() is not being called from
snprintf() in our port file.

-- 
  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

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-03-02 02:32:39
Subject: Re: snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-02 00:28:35
Subject: Re: [HACKERS] snprintf causes regression tests to fail

pgsql-patches by date

Next:From: Tom LaneDate: 2005-03-02 02:32:39
Subject: Re: snprintf causes regression tests to fail
Previous:From: Thomas F.O'ConnellDate: 2005-03-01 23:23:52
Subject: Re: Where to see the patch queue (was Re: [PATCHES] Patch

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2005-03-02 02:32:39
Subject: Re: snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-02 00:28:35
Subject: Re: [HACKERS] snprintf causes regression tests to fail

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