Re: Compilation warnings
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Compilation warnings
- From: Mike Pall <mikelu-0710@...>
- Date: 2007年10月23日 13:48:58 +0200
Hi,
Roberto Ierusalimschy wrote:
> > Using MAX_SIZET/2 is probably safer, but too limiting for 16 bit
> > platforms (some have a 16 bit size_t and a 32 bit ptrdiff_t).
>
> Maybe ptrdiff_max would be more appropriate.
Umm, no. This leads to size_t overflow on 16 bit platforms.
MAX_ALLOC = min(MAX_SIZET, MAX_PTRDIFFT) - safety_margin
Bye,
Mike