Thread

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

    Ernst Molitor <ernst@mibi02.meb.uni-bonn.de> — 1998-12-31T11:34:11Z

    ============================================================================
                            POSTGRESQL BUG REPORT TEMPLATE
    ============================================================================
    
    
    Your name		:	Ernst Molitor
    Your email address	:	ernst@mibi02.meb.uni-bonn.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