Ken Camann wrote:
> In trying to port postgres to 64-bit Windows, I've encountered a
> number of issues which may (or may not) affect other compilers.  If
> you followed the other thread, this is mostly a summary with a bit
> more details so feel free to ignore it.  Some of these may have some
> minor effects on other platforms, so they may be of interest (but I
> doubt it, since no one has noticed/complained about them yet).  This
> post contains a small taxonomy of the problems, as well as some
> discussion about the work that needs to be done in order to make
> postgres portable to LLP64 data model compilers (in case someone else
> is interested).  I use the standard terms for discussing different
> compiler data models, which are explained here:
> 
> http://www.unix.org/version2/whatsnew/lp64_wp.html
> 
> Throughout this post I will assume sizeof(size_t) == sizeof(void*),
> because I doubt you want to support a system where this is not the
> case.
> 
> 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:
> 
> int len;
> 
> len = strlen(str);
> 
...
> 
> int len;
> 
> len = (int)strlen(str);

If we know we are addressing a datum that has to be <4GB, it would be
best to use some typedef that is descriptive, like:

  len = (DatumLen)strlen(str);

-- 
  Bruce Momjian  <[EMAIL PROTECTED]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to