Subject: Re: SIZE_T_MAX Problem
To: Christian Limpach <chris@pin.lu>
From: Simon Burge <simonb@wasabisystems.com>
List: current-users
Date: 08/18/2003 10:36:43
Christian Limpach wrote:

> Quoting Christos Zoulas <christos@zoulas.com>:
> > Jason Hecker <jhecker@wireless.org.au> wrote:
> 
> > It should be defined in /usr/include/powerpc/limits.h on the ppc case.
> > Is that directory/file there?
> 
> not on Linux, which is where the original poster wants to build.sh.  Linux 
> has in /usr/include/stdint.h:
> /* Limit of `size_t' type.  */
> # if __WORDSIZE == 64
> #  define SIZE_MAX              (18446744073709551615UL)
> # else
> #  define SIZE_MAX              (4294967295U)
> # endif
> 
> I have:
> #if !defined(SIZE_T_MAX) && defined(SIZE_MAX)
> #define SIZE_T_MAX SIZE_MAX
> #endif
> in my cat.c or compat_defs.h but maybe it should be named SIZE_MAX anyway 
> (cf. UINT32_MAX, U?QUAD_MAX, ...)

SUSv3 doesn't mention SIZE_T_MAX.  It does mention SIZE_MAX (which
should be in <stdint.h>) which we do support in 1.6 but not 1.5.

I'd suggest that we use SIZE_MAX in our sources, and let the compat goop
define that in terms of SIZE_T_MAX if SIZE_MAX doesn't exist.  Sound
good?

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/