[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIZE_MAX
From: |
Bruno Haible |
Subject: |
Re: SIZE_MAX |
Date: |
Tue, 6 Oct 2009 23:48:37 +0200 |
User-agent: |
KMail/1.9.9 |
Simon Josefsson wrote:
> > I suppose these should include stdint.h also?
> >
> > areadlink.c:# define SIZE_MAX ((size_t) -1)
> > areadlink-with-size.c:# define SIZE_MAX ((size_t) -1)
> > backupfile.c:# define SIZE_MAX ((size_t) -1)
> > fnmatch.c:# define SIZE_MAX ((size_t) -1)
> > quotearg.c:# define SIZE_MAX ((size_t) -1)
> > striconv.c:# define SIZE_MAX ((size_t) -1)
>
> Note that stdint.h may not be sufficient to get SIZE_MAX, quoting
> size_max.h:
>
> /* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
> # include <limits.h>
> /* Get SIZE_MAX declaration on systems like glibc 2. */
> # if HAVE_STDINT_H
> # include <stdint.h>
> # endif
> /* On systems where these include files don't define it, SIZE_MAX is defined
> in config.h. */
>
> However given that SIZE_MAX should be in stdint.h according to POSIX
POSIX says <stdint.h> must define SIZE_MAX, and the gnulib 'stdint' module
does it. It's only when the gnulib 'stdint' module is *not* in use that
you have to use the size_max.h file.
> maybe it makes more sense to make sure gnulib's stdint.h replacement is
> enabled when SIZE_MAX is not provided by the system's stdint.h?
m4/stdint.m4 does exactly this.
> And then deprecate size_max.h in favor of stdint.
We talked about it in this thread:
<http://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00193.html>
I explained why the size_max module is needed. But I have no problems with
discouraging its use:
2009-10-06 Bruno Haible <address@hidden>
* modules/size_max (Description): Discourage its use.
Reported by Simon Josefsson.
--- modules/size_max.orig 2009-10-06 23:47:04.000000000 +0200
+++ modules/size_max 2009-10-06 23:41:51.000000000 +0200
@@ -1,5 +1,5 @@
Description:
-Provide SIZE_MAX.
+Provide SIZE_MAX, for cases when the 'stdint' module cannot be used.
Files:
m4/size_max.m4
- Re: new snapshot available: coreutils-7.6.63-addb6, (continued)
- Re: new snapshot available: coreutils-7.6.63-addb6, Jim Meyering, 2009/10/06
- size_max, Simon Josefsson, 2009/10/06
- Re: size_max, Eric Blake, 2009/10/06
- Re: size_max, Simon Josefsson, 2009/10/06
- Re: size_max, Bruno Haible, 2009/10/06
- Re: size_max, Bruno Haible, 2009/10/06
- Re: size_max, Eric Blake, 2009/10/06
- Re: size_max, Bruno Haible, 2009/10/06
- Re: size_max, Simon Josefsson, 2009/10/07
- Re: new snapshot available: coreutils-7.6.63-addb6, Eric Blake, 2009/10/06
- Re: SIZE_MAX,
Bruno Haible <=
- Re: SIZE_MAX, Simon Josefsson, 2009/10/07
- Re: new snapshot available: coreutils-7.6.63-addb6, Paolo Bonzini, 2009/10/06
- Re: new snapshot available: coreutils-7.6.63-addb6, Pádraig Brady, 2009/10/06
Message not available
Message not available