[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] Re: xsize.h needs SIZE_MAX defined on Windows
From: |
Mark D. Baushke |
Subject: |
Re: [Bug-gnulib] Re: xsize.h needs SIZE_MAX defined on Windows |
Date: |
Thu, 11 Mar 2004 11:19:05 -0800 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Eggert <address@hidden> writes:
> Derek Robert Price <address@hidden> writes:
>
> > Mark D. Baushke from the CVS development team suggested that ~0 might be
> > a better value than -1 as it is more obviously positive.
>
> But ~0 == 0 on hosts with ones'-complement arithmetic; and on such
> hosts, (size_t) ~0 == 0. There are C compilers for some
> ones'-complement hosts (though admittedly they're a bit unusual as
> porting targets for GNU code these days :-).
On such machines, I would expect that ((size_t) -1) is also a
problematic assignment (I must admit that I have mostly used
twos-complement machines).
> Anyway, I don't see why the fix is needed at all. The gl_XSIZE
> autoconf macro invokes gl_SIZE_MAX, which should arrange for SIZE_MAX
> to be defined. The advantage of this approach is that the resulting
> SIZE_MAX can be used in C preprocessor expressions.
Yes, that would be a good thing.
-- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQFAULuo3x41pRYZE/gRAgRMAJ4yjukMW7ct58fi48EOxbyQKu04XgCgkp/L
2Po8qKpZLLnhmQg48FPb1nQ=
=eBmQ
-----END PGP SIGNATURE-----