Re: Beta going well

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Beta going well
Date: 2001-11-06 22:50:47
Message-ID: Pine.LNX.4.30.0111061358200.1111-200000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> > However I'm not sure if it's a correct solution. Problem is, AIX 5L
> > has sys/inttypes.h where int8, int16, int32 and int64 are
> > defined. Should we detect them in configure? Also, I'm afraid it would
> > break other AIX versions. Comments?
>
> Perhaps have configure test for the presence of <sys/inttypes.h>
> and then let c.h do
>
> #ifdef HAVE_SYS_INTTYPES_H
> #include <sys/inttypes.h>
> #else
> typedef signed char int8;
> ... etc
> #endif

This is not correct, since we don't have any portable guarantees about the
content of <sys/inttypes.h>.

The correct way would be to check for the existance of int8, int16, etc.
The Autoconf <=2.13 macros for existance of types have been deprecated in
2.50 because they're broken. (If the type is missing the replacement type
is #define'd, not typedef'd, which is claimed to be incorrect. I don't
know why offhand, but let's not start finding out now.)

A possible workaround until we update our Autoconf (not now) would be

AC_CHECK_SIZEOF(int8)

#if SIZEOF_INT8 == 0
typedef signed char int8;
#endif

because the sizeof check results in 0 if the type doesn't exist.

I have attached a patch to this effect which I ask the affected people to
try out.

This patch could theoretically be insufficient if 'long int' is 64 bits
but int64 exists and is actually 'long long int'. You would probably get
warnings about mismatched printf arguments, but I don't think there would
be actual problems.

--
Peter Eisentraut peter_e(at)gmx(dot)net

Attachment Content-Type Size
int8-patch text/plain 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-11-06 22:53:55 Re: Proposal: 7.2b2 today
Previous Message Tom Lane 2001-11-06 22:49:55 Re: Beta going well