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

Re: oid failures on Alpha solved

From: Brent Verner <brent(at)rcfile(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: oid failures on Alpha solved
Date: 2000-12-30 20:04:16
Message-ID: 20001230150416.A32606@rcfile.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On 30 Dec 2000 at 12:57 (-0500), Tom Lane wrote:
| Brent Verner <brent(at)rcfile(dot)org> writes:
| > formatting '-1040' with '%u'
| >   snprintf = 18446744073709550576
| >   sprintf  = 4294966256
| 
| > oidout() is where the offending call originates, FWIW.
| >   snprintf(result, 12, "%u", o);
| 
| Hm.  This is clearly a bug in snprintf.  Did I understand you correctly
| that configure is choosing backend/port/snprintf.c rather than one from
| the C library?  If so, it should be straightforward to fix.

yes, backend/port/snprintf.c is being used.

| >   1) could the openssh code be a candidate to replace our version? It 
| >      looks quite a bit more 'featureful', and I'd imagine it is about 
| >      as safe as snprintf gets.
| 
| (a) what's the license?  (b) is it a lot bigger than the one we have?

a) no license in file. file is obviously 'related' to the current
   version used in postgresql. version I used came with openssh-2.?,
   so if any license is applicable, i'd imagine it's BSD-like.
b) 10.7k postgresql snprintf.c
   18.4k openssh snprintf.c
   (a sizable portion of this size difference is a test main() at the
    end of the file openssh file, which I found useful)

you can snag a slightly modified-to-work-in-postgres copy from 
http://pg.rcfile.org/alpha/snprintf.c if you'd like to check it out.
it is a drop in replacement as it stands. my changes to the original
were s/long double/double/g and moving some #cpp directives around.

| >   2) do we _need_ oidout() to "%u", or could we "%lu" and fully take
| >      advantage of the longer long on 64bit platforms?
| 
| OID is 4 bytes and %u is the correct format for it.  8-byte OIDs are a
| can of worms that we will *not* open just now.

right on.

cheers.
  brent

In response to

pgsql-hackers by date

Next:From: Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=Date: 2000-12-30 20:04:28
Subject: Re: GNU readline and BSD license
Previous:From: Tom LaneDate: 2000-12-30 19:24:38
Subject: Re: oid failures on Alpha solved

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