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

2005-03-01 Thread Tom Lane
Nicolai Tufar [EMAIL PROTECTED] writes:
 Amazingly enough HAVE_LONG_LONG_INT_64 is
 defined when compilation comes to src/port/snprintf.c
 but the result is still wrong. I looked into configure.in
 but the check for HAVE_LONG_LONG_INT_64 is too
 complicated for me to understand. Bruce, could you
 take a look at this? I am 90% sure it is an issue with
 some configure definitions.

Just out of curiosity, do either HAVE_INT64 or HAVE_UINT64 get set
in pg_config.h?  The observed symptoms would be explained if typedef
int64 were ending up as long rather than long long.  Looking at
the #ifdef nest in include/c.h, there are a couple of ways that could
happen, including importing a definition from system header files.

If this were happening, it would presumably break all int8 math not
only snprintf, so I'm not sure it's the story.  As far as I've seen,
no one has actually posted the regression diffs seen in this failure,
so most of us are in the dark about the details of the problem.

regards, tom lane

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


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

2005-03-01 Thread Nicolai Tufar
On Tue, 01 Mar 2005 17:45:31 -0500, Tom Lane  Just out of curiosity,
do either HAVE_INT64 or HAVE_UINT64 get set
 in pg_config.h?  

pg_config.h is attached. What drew my attention is the
following declaration:

/* Define to 1 if `long long int' works and is 64 bits. */
#define HAVE_LONG_LONG_INT_64


is it normal? should it not be like this:
#define HAVE_LONG_LONG_INT_64 1
/* src/include/pg_config.h.  Generated by configure.  */
/* src/include/pg_config.h.in.  Generated from configure.in by autoheader.  */

/* Define to the type of arg 1 of 'accept' */
#define ACCEPT_TYPE_ARG1 unsigned int

/* Define to the type of arg 2 of 'accept' */
#define ACCEPT_TYPE_ARG2 struct sockaddr *

/* Define to the type of arg 3 of 'accept' */
#define ACCEPT_TYPE_ARG3 int

/* Define to the return type of 'accept' */
#define ACCEPT_TYPE_RETURN unsigned int PASCAL

/* The alignment requirement of a `double'. */
#define ALIGNOF_DOUBLE 8

/* The alignment requirement of a `int'. */
#define ALIGNOF_INT 4

/* The alignment requirement of a `long'. */
#define ALIGNOF_LONG 4

/* The alignment requirement of a `long long int'. */
#define ALIGNOF_LONG_LONG_INT 8

/* The alignment requirement of a `short'. */
#define ALIGNOF_SHORT 2

/* Define to the default TCP port number on which the server listens and to
   which clients will try to connect. This can be overridden at run-time, but
   it's convenient if your clients have the right default compiled in.
   (--with-pgport=PORTNUM) */
#define DEF_PGPORT 5432

/* Define to the default TCP port number as a string constant. */
#define DEF_PGPORT_STR 5432

/* Define to 1 if you want National Language Support. (--enable-nls) */
/* #undef ENABLE_NLS */

/* Define to 1 to build client libraries as thread-safe code.
   (--enable-thread-safety) */
/* #undef ENABLE_THREAD_SAFETY */

/* Define to 1 if getpwuid_r() takes a 5th argument. */
/* #undef GETPWUID_R_5ARG */

/* Define to 1 if gettimeofday() takes only 1 argument. */
/* #undef GETTIMEOFDAY_1ARG */

#ifdef GETTIMEOFDAY_1ARG
# define gettimeofday(a,b) gettimeofday(a)
#endif

/* Define to 1 if you have the `atexit' function. */
#define HAVE_ATEXIT 1

/* Define to 1 if you have the `cbrt' function. */
#define HAVE_CBRT 1

/* Define to 1 if you have the `class' function. */
/* #undef HAVE_CLASS */

/* Define to 1 if you have the `crypt' function. */
/* #undef HAVE_CRYPT */

/* Define to 1 if you have the crypt.h header file. */
/* #undef HAVE_CRYPT_H */

/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
   don't. */
#define HAVE_DECL_FDATASYNC 0

/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
   don't. */
#define HAVE_DECL_SNPRINTF 1

/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
   don't. */
#define HAVE_DECL_VSNPRINTF 1

/* Define to 1 if you have the dld.h header file. */
/* #undef HAVE_DLD_H */

/* Define to 1 if you have the `dlopen' function. */
/* #undef HAVE_DLOPEN */

/* Define to 1 if you have the editline/history.h header file. */
/* #undef HAVE_EDITLINE_HISTORY_H */

/* Define to 1 if you have the editline/readline.h header file. */
/* #undef HAVE_EDITLINE_READLINE_H */

/* Define to 1 if you have the endian.h header file. */
/* #undef HAVE_ENDIAN_H */

/* Define to 1 if you have the `fcvt' function. */
#define HAVE_FCVT 1

/* Define to 1 if you have the `fdatasync' function. */
/* #undef HAVE_FDATASYNC */

/* Define to 1 if you have finite(). */
#define HAVE_FINITE 1

/* Define to 1 if you have the `fpclass' function. */
/* #undef HAVE_FPCLASS */

/* Define to 1 if you have the `fp_class' function. */
/* #undef HAVE_FP_CLASS */

/* Define to 1 if you have the `fp_class_d' function. */
/* #undef HAVE_FP_CLASS_D */

/* Define to 1 if you have the fp_class.h header file. */
/* #undef HAVE_FP_CLASS_H */

/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
/* #undef HAVE_FSEEKO */

/* Define to 1 if your compiler understands __func__. */
#define HAVE_FUNCNAME__FUNC 1

/* Define to 1 if your compiler understands __FUNCTION__. */
/* #undef HAVE_FUNCNAME__FUNCTION */

/* Define to 1 if you have the `getaddrinfo' function. */
/* #undef HAVE_GETADDRINFO */

/* Define to 1 if you have the `gethostbyname_r' function. */
/* #undef HAVE_GETHOSTBYNAME_R */

/* Define to 1 if you have the `gethostname' function. */
/* #undef HAVE_GETHOSTNAME */

/* Define to 1 if you have the `getopt' function. */
#define HAVE_GETOPT 1

/* Define to 1 if you have the getopt.h header file. */
#define HAVE_GETOPT_H 1

/* Define to 1 if you have the `getopt_long' function. */
#define HAVE_GETOPT_LONG 1

/* Define to 1 if you have the `getpeereid' function. */
/* #undef HAVE_GETPEEREID */

/* Define to 1 if you have the `getpwuid_r' function. */
/* #undef HAVE_GETPWUID_R */

/* Define to 1 if you have the `getrusage' function. */
/* #undef HAVE_GETRUSAGE */

/* Define to 1 if you have the history.h header file. */
/* #undef HAVE_HISTORY_H */

/* Define to 1 if 

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

2005-03-01 Thread Bruce Momjian
Nicolai Tufar wrote:
 On Tue, 01 Mar 2005 17:45:31 -0500, Tom Lane [EMAIL PROTECTED] wrote:
  Nicolai Tufar [EMAIL PROTECTED] writes:
  Just out of curiosity, do either HAVE_INT64 or HAVE_UINT64 get set
  in pg_config.h?  The observed symptoms would be explained if typedef
  int64 were ending up as long rather than long long.  Looking at
  the #ifdef nest in include/c.h, there are a couple of ways that could
  happen, including importing a definition from system header files.
  
  If this were happening, it would presumably break all int8 math not
  only snprintf, so I'm not sure it's the story.  
 
 I am looking into it. Will report if find something of importance.
 
  As far as I've seen,
  no one has actually posted the regression diffs seen in this failure,
  so most of us are in the dark about the details of the problem.
 
 Regression diiff is attached. The problem is reported by Magnus
 and me. Probably nobody else compiles pg under Win32 these
 days.

I am testing the failure here.  I will keep at it until I find the
cause.

The only downside is that Win32 compiles are much slower than Unix.

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

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings