Re: RELEASE STOPPER? nonportable int64 constants in pg_crc.c

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: "'tgl(at)sss(dot)pgh(dot)pa(dot)us'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RELEASE STOPPER? nonportable int64 constants in pg_crc.c
Date: 2001-03-21 20:51:49
Message-ID: Pine.LNX.4.30.0103212149270.1694-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zeugswetter Andreas SB writes:

>
> Recent changes in pg_crc.c (64 bit CRC) introduced non portable constants of the form:
>
> -c -o pg_crc.o pg_crc.c
> 287 | 0x0000000000000000, 0x42F0E1EBA9EA3693,
> ............................a..................
> a - 1506-207 (W) Integer constant 0x42F0E1EBA9EA3693 out of range.
>
> I guess this will show up on a lot of non gcc platforms !!!!!
> It shows no diffs in the regression tests! From what I understand,
> failure would only show up after fast shutdown/crash.
>
> Attached is a patch, but I have no idea how portable that is.

I don't think it's the answer either. The patch assumes that int64 ==
long long. The ugly solution might have to be:

#if <int64 == long>
#define L64 L
#else
#define L64 LL
#endif

const uint64 crc_table[256] = {
0x0000000000000000##L64, 0x42F0E1EBA9EA3693##L64,
0x85E1C3D753D46D26##L64, 0xC711223CFA3E5BB5##L64,
...

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles DAROLD 2001-03-21 20:53:46 Re: [HACKERS] Call for platforms AIX 4.3.3 Failed
Previous Message Bruce Momjian 2001-03-21 20:48:35 Re: pgindent run?