acl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.

2025-02-11 Thread Collin Funk
In Emacs, I saw the following warning: In file included from /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h:9, from file-has-acl.c:53: /usr/include/stdint.h:216:11: warning: "SIZE_MAX" redefined 216 | # define SIZE_MAX (184467440737

[PATCH] xsize: port to SIZE_MAX <= INT_MAX

2024-06-14 Thread Paul Eggert
* lib/xsize.h (xsum): Port to oddball platforms where SIZE_MAX <= INT_MAX. Although no such platform is a current Gnulib porting problems, it’s easy enough to port to them. --- ChangeLog | 5 + lib/xsize.h | 18 ++ 2 files changed, 19 insertions(+), 4 deletions(-) d

[PATCH 5/8] xalloc-oversized: fix SIZE_MAX optimization bug

2021-04-18 Thread Paul Eggert
* lib/xalloc-oversized.h (xalloc_count_t): Remove; no longer needed and was evidently error-prone anyway. (xalloc_oversized): Omit some over-optimization that caused SIZE_MAX to not be treated as too large (the Gnulib convention) on unusual platforms where PTRDIFF_MAX == SIZE_MAX. This change

Re: [PATCH] read-file: reduce max size from SIZE_MAX to PTRDIFF_MAX

2020-02-02 Thread Bruno Haible
> +2020-02-02 Pádraig Brady > + > + read-file: reduce max size from SIZE_MAX to PTRDIFF_MAX Looks good as well. Bruno

[PATCH] read-file: reduce max size from SIZE_MAX to PTRDIFF_MAX

2020-02-02 Thread Pádraig Brady
-file.c: s/SIZE_MAX/PTRDIFF_MAX/ --- ChangeLog | 11 +++ lib/read-file.c | 10 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e5f94d3c..86f8626d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2020-02-02 Pád

[PATCH] stddef-tests: port to SIZE_MAX <= INT_MAX

2017-02-08 Thread Paul Eggert
* tests/test-stddef.c: Include , for INT_MAX. Do not assume that INT_MAX < SIZE_MAX. --- ChangeLog | 6 ++ tests/test-stddef.c | 6 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eec777f..3052549 100644 --- a/ChangeLog ++

[PATCH 1/2] glob: don't assume INT_MAX < SIZE_MAX

2016-05-12 Thread Paul Eggert
* lib/glob.c (glob): Prefer SIZE_MAX to ~((size_t) 0), as the latter is not portable to (probably theoretical) hosts where SIZE_MAX <= INT_MAX. --- ChangeLog | 7 +++ lib/glob.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8ba

Re: [PATCH] stdint, read-file: fix missing SIZE_MAX on Android

2014-03-05 Thread Paul Eggert
re we should start the ball rolling on getting papers. diff --git a/ChangeLog b/ChangeLog index 4e1984c..2f847e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-03-04 Kevin Cernekee + + stdint, read-file: fix missing SIZE_MAX on Android (tiny change) + This is basically one o

Re: [PATCH] stdint, read-file: fix missing SIZE_MAX on Android

2014-03-05 Thread Kevin Cernekee
On Wed, Mar 5, 2014 at 2:42 PM, Paul Eggert wrote: > Thanks for the bug report and patch. A couple of things. First, the > commentary is big enough so that we'd need a copyright assignment for this > -- if you and your employer are OK with that please let me know and I'll > start the ball rollin

Re: [PATCH] stdint, read-file: fix missing SIZE_MAX on Android

2014-03-05 Thread Paul Eggert
Thanks for the bug report and patch. A couple of things. First, the commentary is big enough so that we'd need a copyright assignment for this -- if you and your employer are OK with that please let me know and I'll start the ball rolling on the paperwork. If this is an issue we can rederive

Re: [PATCH] stdint, read-file: fix missing SIZE_MAX on Android

2014-03-05 Thread Kevin Cernekee
e.o read-file.c > read-file.c: In function 'fread_file': > read-file.c:62:17: error: 'SIZE_MAX' undeclared (first use in this > function) > read-file.c:62:17: note: each undeclared identifier is reported only once > for each function it appears in &g

[PATCH] stdint, read-file: fix missing SIZE_MAX on Android

2014-03-05 Thread Kevin Cernekee
le.c:62:17: error: 'SIZE_MAX' undeclared (first use in this function) read-file.c:62:17: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [read-file.o] Error 1 Bionic puts SIZE_MAX in , but gnulib tries to make it available from ou

Re: [Patch] fix include for SIZE_MAX with Bionic libc

2013-01-15 Thread Eric Blake
On 01/15/2013 08:16 AM, Andoni Morales wrote: > Hi, > > Attached patch to fix the build with the Android NDK for x86. This was > triggered building libtasn1 with the following error: > > read-file.c: In function 'fread_file': > read-file.c:62:17: error: 'SIZ

[Patch] fix include for SIZE_MAX with Bionic libc

2013-01-15 Thread Andoni Morales
-o .libs/read-file.o read-file.c: In function 'fread_file': read-file.c:62:17: error: 'SIZE_MAX' undeclared (first use in this function) read-file.c:62:17: note: each undeclared identifier is reported only once for each function it appears in Cheers, Andoni 0001-read-

[PATCH 2/3] regex: rely on stdint.h for SIZE_MAX

2012-02-07 Thread Paul Eggert
* lib/regex_internal.h (SIZE_MAX): Remove; stdint.h supplies this now. --- ChangeLog|5 + lib/regex_internal.h |5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9171da1..932a396 100644 --- a/ChangeLog +++ b/ChangeLog

Re: size_max

2009-10-06 Thread Simon Josefsson
> > * lib/size_max.h: Remove file. > * modules/size_max (Files): Remove lib/size_max.h. > (Makefile.am): Don't add size_max.h to lib_SOURCES. > (Include): Remove size_max.h. Add its essential contents instead. > * lib/xsize.h: Add comments, original

Re: SIZE_MAX

2009-10-06 Thread Simon Josefsson
Bruno Haible writes: > I explained why the size_max module is needed. But I have no problems with > discouraging its use: I think that will help -- I believe I pulled in the size_max module into one of my projects by mistake, where I should have used stdint instead. I think better documen

Re: size_max

2009-10-06 Thread Bruno Haible
Eric Blake wrote: > > Hello? You propose to remove a file that is in use by other files in gnulib, > > without explaining what to do with the other files. ?! > > No. Reread the proposal. The size_max module stays, and the used file > m4/size_max.m4 remains available for

Re: size_max

2009-10-06 Thread Bruno Haible
Simon Josefsson wrote: > I recall some reports about SIZE_MAX problem anyway, but it may > because of config.h or size_max.m4 issues. You reported a problem in this area, and it was fixed immediately: <http://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00224.html>. > Also,

Re: size_max

2009-10-06 Thread Eric Blake
Bruno Haible clisp.org> writes: > > +2009-10-06 Simon Josefsson josefsson.org> > > + > > + * lib/size_max.h: Remove file. > > + * modules/size_max: Drop size_max.h. > > + * NEWS: Explain. > > Hello? You propose to remove a file that is

Re: size_max

2009-10-06 Thread Bruno Haible
Jim Meyering wrote: > AFAICS, gettext and xsize are the only gnulib modules that use it, > so deprecating size_max sounds like a good idea, assuming > Bruno doesn't mind adjusting those two modules. In <http://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00224.html> why

Re: SIZE_MAX

2009-10-06 Thread Bruno Haible
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 S

Re: size_max

2009-10-06 Thread Simon Josefsson
Eric Blake writes: > Simon Josefsson josefsson.org> writes: > >> So how about this patch? >> >> Of course, stdint.h has to define SIZE_MAX on these systems to make sure >> it will still work. But I suppose we'll notice if it doesn't already. >

Re: size_max

2009-10-06 Thread Eric Blake
Simon Josefsson josefsson.org> writes: > So how about this patch? > > Of course, stdint.h has to define SIZE_MAX on these systems to make sure > it will still work. But I suppose we'll notice if it doesn't already. stdint.in.h already takes care of SIZE_MAX. >

size_max

2009-10-06 Thread Simon Josefsson
Jim Meyering writes: >> However given that SIZE_MAX should be in stdint.h according to POSIX, >> 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? And >> then depre

Re: SIZE_MAX

2009-06-01 Thread Simon Josefsson
Bruno Haible writes: >> How about clarifying the intentions behind the size_max module a bit >> better? It seems most applications will want to include stdint.h and >> depend on the stdint gnulib module, rather than using the gnulib >> size_max module. > > Exactly,

Re: SIZE_MAX

2009-05-31 Thread Bruno Haible
of intl/. > > vasnprintf.c, which > > depends on xsize.h, which needs a definition of SIZE_MAX. For this reason, > > xsize.h arranges to get a correct SIZE_MAX in the cheapest possible way. > > Ok, that makes sense. I note that xsize.h does not include size_max.h. > Should i

Re: SIZE_MAX

2009-05-26 Thread Simon Josefsson
Bruno Haible writes: > Simon Josefsson wrote: >> Bruno, what do you think about simply deprecating the size_max module? > > This would cause problems in libintl. The intl/ directory, when shipped > as part of a package that used gettextize, should not create its own copy > o

Re: SIZE_MAX

2009-05-26 Thread Simon Josefsson
Bruno Haible writes: > Simon Josefsson wrote: >> Bruno, what do you think about simply deprecating the size_max module? > > This would cause problems in libintl. The intl/ directory, when shipped > as part of a package that used gettextize, should not create its own copy >

Re: SIZE_MAX

2009-05-26 Thread Simon Josefsson
Bruno Haible writes: >> I got a report about SIZE_MAX problems: >> >> In file included from ../gnutls_int.h:29, >> from opencdk.h:30, >> from kbnode.c:31: >> ../config.h:357:1: warning: "SIZE_MAX" redefine

Re: getdelim: use SIZE_MAX from stdint.h

2009-05-26 Thread Simon Josefsson
Bruno Haible writes: > Simon Josefsson wrote: >> The getdelim module already implicitly depends on stdint > > I don't think it did. 'realloc-posix' depends on stdlib, not stdint. > So what you added is a new dependency. The stdlib module depends on stdint. > Some people, like Sam Steingold, wan

Re: SIZE_MAX

2009-05-21 Thread Eric Blake
Ben Pfaff cs.stanford.edu> writes: > > +[/* Define as the maximum value of type 'size_t', if the system doesn't define > > + it. */ > > +#ifndef SIZE_MAX > > +# undef SIZE_MAX > > +#endif]) > > ]) > > This logic looks wrong. Ta

Re: SIZE_MAX

2009-05-21 Thread Ben Pfaff
Bruno Haible writes: > +[/* Define as the maximum value of type 'size_t', if the system doesn't > define > + it. */ > +#ifndef SIZE_MAX > +# undef SIZE_MAX > +#endif]) > ]) This logic looks wrong. -- "Premature optimization is the root of all evil

Re: SIZE_MAX

2009-05-21 Thread Bruno Haible
Simon Josefsson wrote: > Bruno, what do you think about simply deprecating the size_max module? This would cause problems in libintl. The intl/ directory, when shipped as part of a package that used gettextize, should not create its own copy of stdint.h. But the intl/ directory conta

Re: getdelim: use SIZE_MAX from stdint.h

2009-05-21 Thread Bruno Haible
Simon Josefsson wrote: > The getdelim module already implicitly depends on stdint I don't think it did. 'realloc-posix' depends on stdlib, not stdint. So what you added is a new dependency. Some people, like Sam Steingold, want to minimize dependencies in gnulib. Especially towards module 'stdint

getdelim: use SIZE_MAX from stdint.h

2009-05-20 Thread Simon Josefsson
TCH] getdelim: Use SIZE_MAX from stdint.h. --- ChangeLog|6 ++ lib/getdelim.c |8 +++- modules/getdelim |1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a153fa9..2c13295 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1

SIZE_MAX

2009-05-19 Thread Simon Josefsson
I got a report about SIZE_MAX problems: In file included from ../gnutls_int.h:29, from opencdk.h:30, from kbnode.c:31: ../config.h:357:1: warning: "SIZE_MAX" redefined In file included from ./../gl/stdlib.h:52, from kbnode.c:28: ./../g

Re: [bug-gnulib] SIZE_MAX and gl_SIZE_MAX

2006-09-28 Thread Bruno Haible
her modules, we can switch to immediately. 2006-09-28 Bruno Haible <[EMAIL PROTECTED]> * modules/avltreehash-list (Depends-on): Add stdint, remove size_max. * modules/linkedhash-list (Depends-on): Likewise. * modules/rbtreehash-list (Depends-on): Likewi

SIZE_MAX and gl_SIZE_MAX

2006-09-25 Thread Paul Eggert
Ralf Wildenhues <[EMAIL PROTECTED]> writes: > 21 checking for SIZE_MAX... yes > > as the top gnulib candidates. The SIZE_MAX test is cheap on systems > that have it There's no reason to have a separate SIZE_MAX module any more, except for inertia, as the stdint mo

Re: Fix size_max macro

2006-06-16 Thread Bruno Haible
of (size_t) <= sizeof (unsigned int)], fits_in_uint, ! [#include ], result=?) ! if test "$fits_in_uint" = 1; then ! dnl Even though SIZE_MAX fits in an unsigned int, it must be of type ! dnl 'unsigned long' if the type 'size_t' is the same as 'unsign

Re: Fix size_max macro

2006-06-13 Thread Bruno Haible
Paul Eggert wrote: > The basic idea seems fine, but isn't that off by a factor of 2? It defines > size_t_bits_minus_2 = sizeof (size_t) * CHAR_BIT - 2 > and then defines SIZE_MAX to (((1U << $size_t_bits_minus_2) - 1) * 2 + 1). > Unless I'm missing something, on

Re: Fix size_max macro

2006-06-13 Thread Paul Eggert
The basic idea seems fine, but isn't that off by a factor of 2? It defines size_t_bits_minus_2 = sizeof (size_t) * CHAR_BIT - 2 and then defines SIZE_MAX to (((1U << $size_t_bits_minus_2) - 1) * 2 + 1). Unless I'm missing something, on a 32-bit host, that will set SIZE_MAX to 21

Fix size_max macro

2006-06-13 Thread Bruno Haible
Hi, The size_max macro has a bug: it assumes that 'expr' can deal with numbers as large as SIZE_MAX/10. Which is not true when cross-compiling from a 32-bit platform to a 64-bit platform. Here is a fix, that takes care that SIZE_MAX is valid in preprocessor expressions (i.e. contain

Re: size_max: remove it?

2006-04-28 Thread Paul Eggert
"Derek R. Price" <[EMAIL PROTECTED]> writes: > It sounds reasonable to leave size_max in for those who want it, but is > it really necessary to make stdint depend on it? All that extra work by > configure sounds like overkill too, when stdint_.h has already included &

Re: size_max: remove it?

2006-04-28 Thread Derek R. Price
Paul Eggert wrote: > Bruno Haible <[EMAIL PROTECTED]> writes: > >> 2) I use the size_max module inside gettext's libintl, and a full-blown >> feels like overkill in this case, when we just need one macro. > > I'd been assuming that the stdint module w

Re: size_max: remove it?

2006-04-27 Thread Paul Eggert
Bruno Haible <[EMAIL PROTECTED]> writes: > 2) I use the size_max module inside gettext's libintl, and a full-blown > feels like overkill in this case, when we just need one macro. I'd been assuming that the stdint module would be modified to depend on size_max, to ca

Re: size_max: remove it?

2006-04-27 Thread Bruno Haible
.m4 magic shouldn't be merged > into the stdint module? 1) Is the 'stdint' module tested as much (on as many platforms) as other gnulib modules? gettext doesn't use it so far. coreutils uses it for 3 months only. clisp uses it but is not tested on so many platforms. 2)

Re: size_max: remove it?

2006-04-27 Thread Bruno Haible
Simon Josefsson wrote: > There is size_max, which does: > > # include This is needed to avoid a "macro redefined" warning e.g. on Solaris 7. > # if HAVE_STDINT_H > # include > # endif This is needed to avoid a "macro redefined" warning e.g. on glibc sy

Re: size_max: remove it?

2006-04-27 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > Still, is there a reason the size_max.m4 magic shouldn't be merged > into the stdint module? Yes, that'd be a logical way to do it. (This was part of my stdint review that I haven't done yet. :-)

Re: size_max: remove it?

2006-04-27 Thread Simon Josefsson
Simon Josefsson <[EMAIL PROTECTED]> writes: > There is size_max, which does: > > # include > # if HAVE_STDINT_H > # include > # endif > > that doesn't seem compatible with the stdint.h module (I'm assuming > that the stdint module doesn't defi

size_max: remove it?

2006-04-27 Thread Simon Josefsson
There is size_max, which does: # include # if HAVE_STDINT_H # include # endif that doesn't seem compatible with the stdint.h module (I'm assuming that the stdint module doesn't define HAVE_STDINT_H). So if there is no stdint.h, and limits.h doesn't define SIZE_MAX, this

Re: FYI: getdelim.c needs SIZE_MAX

2005-10-06 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: > >>Derek Price <[EMAIL PROTECTED]> writes: >> >> >>>may not be defined. I've installed the attached patch, ripped verbatim >>>from serveral other modules. &g

Re: FYI: getdelim.c needs SIZE_MAX

2005-10-05 Thread Paul Eggert
Derek Price <[EMAIL PROTECTED]> writes: > I think the size_max module is only important if you want to use > SIZE_MAX as part of a preprocessor conditional Yes, that's my recollection as well. ___ bug-gnulib mailing list bug-gn

Re: FYI: getdelim.c needs SIZE_MAX

2005-10-05 Thread Derek Price
Simon Josefsson wrote: >Derek Price <[EMAIL PROTECTED]> writes: > > >>may not be defined. I've installed the attached patch, ripped verbatim >>from serveral other modules. >> >> > >Shouldn't we use the size_max module instead? > &

Re: FYI: getdelim.c needs SIZE_MAX

2005-10-05 Thread Simon Josefsson
AX): New macro, if not already defined. > (getdelim): Fix buffer overrun on 64-bit hosts with lines longer > than 2 GiB. > > The problem is that the new SSIZE_MAX macro depends on SIZE_MAX, which > may not be defined. I've installed the attached patch, ripped ver

FYI: getdelim.c needs SIZE_MAX

2005-10-05 Thread Derek Price
4-bit hosts with lines longer than 2 GiB. The problem is that the new SSIZE_MAX macro depends on SIZE_MAX, which may not be defined. I've installed the attached patch, ripped verbatim from serveral other modules. 2005-10-05 Derek Price <[EMAIL PROTECTED]> * getdelim.c (SI

Re: size_max module: missing Makefile.am entry

2005-09-04 Thread Simon Josefsson
Martin Lambers <[EMAIL PROTECTED]> writes: > Hi! > > I think the size_max module misses the Makefile.am entry > "lib_SOURCES += size_max.h": > > $ ./gnulib-tool --create-testdir --dir=/tmp/t size_max > $ cd /tmp/t > $ ./configure > $ make dist > >

size_max module: missing Makefile.am entry

2005-09-03 Thread Martin Lambers
Hi! I think the size_max module misses the Makefile.am entry "lib_SOURCES += size_max.h": $ ./gnulib-tool --create-testdir --dir=/tmp/t size_max $ cd /tmp/t $ ./configure $ make dist The resulting tarball does not contain size_max.h. The following patch fixes this: --- modules/siz

Re: size_max

2005-07-11 Thread Simon Josefsson
lains. >> >> > 2004-12-28 Simon Josefsson <[EMAIL PROTECTED]> >> > >> > * modules/size_max: New file. >> > >> >* modules/xsize: Depend on size_max module for size_max.m4. >> > >> > 2005-01-21 Simon Josefsson &l

Re: size_max

2005-07-11 Thread Bruno Haible
ED]> > > > > * modules/size_max: New file. > > > > * modules/xsize: Depend on size_max module for size_max.m4. > > > > 2005-01-21 Simon Josefsson <[EMAIL PROTECTED]> > > > > * size_max.h: New file. Fine with me. Please install

Re: [bug-gnulib] Re: size_max

2005-07-11 Thread Bruno Haible
Paul Eggert wrote: > Also, while we're on the subject of size_max.m4, I have a pedantic > point: its use of ~(size_t)0 isn't portable in general. For example, > if size_t is narrower than int, then ~(size_t)0 might evaluate to -1, > which isn't correct. Ah, right. I'm changing it to (size_t)~(siz

Re: size_max

2005-06-25 Thread Simon Josefsson
Paul Eggert <[EMAIL PROTECTED]> writes: >> In this case, I think naming me and Bruno as maintainer would be the >> right thing. Ok? > > It's fine with me, though I'd like to hear Bruno's opinion. Yup, I'll wait for Bruno's response. &

Re: size_max

2005-06-24 Thread Paul Eggert
a aren't formal, but basically it's the person who makes sure that the code is fixed and/or improved when needed. > In this case, I think naming me and Bruno as maintainer would be the > right thing. Ok? It's fine with me, though I'd like to hear Bruno's opinion. &

Re: size_max

2005-06-24 Thread Simon Josefsson
Bruno as maintainer would be the right thing. Ok? +Maintainer: +Simon Josefsson +Bruno Haible Another complication: Should we start replacing /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif and/or #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif with /* Get SIZE_MAX

Re: size_max

2005-06-24 Thread Paul Eggert
Simon Josefsson <[EMAIL PROTECTED]> writes: > How about this? The patch was discussed and revised a few times some > months ago. Nobody complained after the last patch was posted. I'll > install this on Sunday, unless someone complains. It seems a bit odd for you to list Bruno as the maintaine

Re: size_max

2005-06-24 Thread Simon Josefsson
;[EMAIL PROTECTED]> > > * modules/size_max: New file. > > * modules/xsize: Depend on size_max module for size_max.m4. > > 2005-01-21 Simon Josefsson <[EMAIL PROTECTED]> > > * size_max.h: New file. Index: lib/size_max.h ===