Re: Summary of some postgres portability issues

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Ken Camann <kjcamann(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Summary of some postgres portability issues
Date: 2008-07-14 19:48:53
Message-ID: 1123.1216064933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> Ken Camann wrote:
>> When I try to compile postgres, I get 396 warnings. These come from
>> several different places:
>>
>> 1.) Most of the code involving strings requires a ILP32 or ILP64 to
>> not generate a warning. This means sizeof(int) == sizeof(size_t) ==
>> 32 or 64, respectively. Something as simple as:

That reminds me, I was going to post another comment on this: maybe the
most effective answer for the OP is to suppress the specific warning
about casting size_t to int. (Maybe his compiler can't do that, but
most commercial compilers I've seen have some such ability.) Because of
the way that Postgres is designed, and the quite a few years of testing
it has had on 64-bit boxes, it's highly unlikely that such coercions are
actually problems; thus, there is not a whole lot of interest in
invasive and perhaps performance-losing patches to get rid of 'em.

The warnings you *do* want to see are the equivalents of gcc's "cast
between pointer and integer of different size" --- if that's separable
from warnings about casts between integer sizes then you're in good
shape.

At the very least, I'd suggest that the correct development path is
to fix the pointer-conversion warnings first, so that you can get a
working port; only then worry about cosmetics.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-07-14 19:49:16 Re: Security and Data Protection Issues
Previous Message Mark Mielke 2008-07-14 19:39:05 Re: Fwd: Proposal - UUID data type