Minor problem with Solaris-2.5/SPARC-1/gcc-2.8.1

From: Ernst Molitor <ernst(at)mibi02(dot)meb(dot)uni-bonn(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Ernst Molitor <ernst(at)mibi02(dot)meb(dot)uni-bonn(dot)de>
Subject: Minor problem with Solaris-2.5/SPARC-1/gcc-2.8.1
Date: 1998-12-31 11:34:11
Message-ID: 199812311134.MAA26574@mibi02.meb.uni-bonn.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Ernst Molitor
Your email address : ernst(at)mibi02(dot)meb(dot)uni-bonn(dot)de

System Configuration
---------------------
Architecture (example: Intel Pentium) : Sun SPARC 1

Operating System (example: Linux 2.0.26 ELF) : SunOS 5.5 (Solaris 2.5)

PostgreSQL version (example: PostgreSQL-6.4) : PostgreSQL-6.5.x
(current CVS sources, as of 12/31/98)

Compiler used (example: gcc 2.8.0) : gcc 2.8.1

Please enter a FULL description of your problem:
------------------------------------------------

The SPARC has HAVE_LONG_LONG_INT_64 defined in include/config.h, the
"corresponding" HAVE_LONG_INT_64 is undefined. In
pgsql/src/backend/port/snprintf.c, the declaration of fmtnum is
"#ifndef'ed" depending on HAVE_LONG_INT_64, while the definition is
"#ifdef'ed" depending on HAVE_LONG_LONG_INT_64. This leads to an error
during compilation, since declaration and definition of fmtnum differ.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

On the local Solaris-2.5/SPARC-1, the commands

./configure --enable-locale --with-perl; make

result in the problem described.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Changing the declaration (around line 119 in the file) to

-- snip, snip --
#ifndef HAVE_LONG_LONG_INT_64
static void fmtnum __P((long value, int base, int dosign, int ljust, int len, int zpad));
#else
static void fmtnum __P((long_long value, int base, int dosign, int ljust, int len, int zpad));
#endif
-- snip, snip --

and the (head of the) definition (around line 339) to

-- snip, snip --
#ifndef HAVE_LONG_LONG_INT_64
static void fmtnum __P((long value, int base, int dosign, int ljust, int len, int zpad))
#else
static void fmtnum __P((long_long value, int base, int dosign, int ljust, int len, int zpad))
#endif
{
-- snip, snip --

solves the compilation problem. In addition, the regression test
reports "ok" for int8.

PostgreSQL is a very impressive product.

Best wishes for the New Year,

Regards,

Yours

Ernst Molitor

Browse pgsql-bugs by date

  From Date Subject
Next Message Torsten Knodt 1999-01-02 15:26:41 PostGresSQL-6.4 backend killed connection to PSQL
Previous Message Michael Leun 1998-12-29 22:06:29 Bug in pg_dump?!