Re: [PATCH 1/7] limits-h: define SSIZE_MAX

2023-05-21 Thread Bruno Haible
Paul Eggert wrote: > * doc/posix-headers/limits.texi (limits.h): Document this. > * lib/limits.in.h (SSIZE_MAX): Define if not already defined. When I add a unit test for this, I see that the assertion static_assert (TYPE_MAXIMUM (ssize_t) == SSIZE_MAX); fails on 64-bit MSVC 14.

[PATCH 5/7] getdelim: use limits-h SSIZE_MAX

2023-05-20 Thread Paul Eggert
on SSIZE_MAX * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c: - * lib/careadlinkat.c: + * lib/careadlinkat.c, lib/getdelim.c: (SSIZE_MAX): Do not define. * modules/areadlink-with-size, modules/areadlinkat-with-size: - * modules/careadlinkat

[PATCH 4/7] careadlinkat: use limits-h SSIZE_MAX

2023-05-20 Thread Paul Eggert
| 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a0b34130..b9c3e49552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,10 @@ limits-h: other modules can rely on SSIZE_MAX * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c

[PATCH 3/7] areadlinkat-with-size: use limits-h SSIZE_MAX

2023-05-20 Thread Paul Eggert
@@ 2023-05-20 Paul Eggert limits-h: other modules can rely on SSIZE_MAX - * lib/areadlink-with-size.c (SSIZE_MAX): - Do not define. - * modules/areadlink-with-size (Depends-on): - Add limits-h. + * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c

[PATCH 2/7] limits-h: other modules can rely on SSIZE_MAX

2023-05-20 Thread Paul Eggert
* lib/areadlink-with-size.c (SSIZE_MAX): Do not define. * modules/areadlink-with-size (Depends-on): Add limits-h. --- ChangeLog | 6 ++ lib/areadlink-with-size.c | 4 modules/areadlink-with-size | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a

[PATCH 7/7] regex: use limits-h SSIZE_MAX

2023-05-20 Thread Paul Eggert
rely on SSIZE_MAX * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c: * lib/careadlinkat.c, lib/getdelim.c, lib/getndelim2.c: + * lib/regex_internal.h: (SSIZE_MAX): Do not define. * modules/areadlink-with-size, modules/areadlinkat-with-size

[PATCH 1/7] limits-h: define SSIZE_MAX

2023-05-20 Thread Paul Eggert
* doc/posix-headers/limits.texi (limits.h): Document this. * lib/limits.in.h (SSIZE_MAX): Define if not already defined. * m4/limits-h.m4 (gl_LIMITS_H): Also generate limits.h if does not define SSIZE_MAX. --- ChangeLog | 6 ++ doc/posix-headers/limits.texi | 6

[PATCH 6/7] getndelim2: use limits-h SSIZE_MAX

2023-05-20 Thread Paul Eggert
rely on SSIZE_MAX * lib/areadlink-with-size.c, lib/areadlinkat-with-size.c: - * lib/careadlinkat.c, lib/getdelim.c: + * lib/careadlinkat.c, lib/getdelim.c, lib/getndelim2.c: (SSIZE_MAX): Do not define. * modules/areadlink-with-size, modules/areadlinkat-with-size

Re: 32-bit glibc bug with SSIZE_MAX

2016-07-13 Thread Eric Blake
On 07/13/2016 06:12 AM, Eric Blake wrote: >> +The macro @code{SSIZE_MAX} has the wrong type, >> +albeit with the correct value: >> +glibc 2.24. >> +@item > > Only 32-bit glibc is buggy; 64-bit glibc is okay. Worse, it's platform-dependent. On 32-bit s390,

Re: 32-bit glibc bug with SSIZE_MAX

2016-07-13 Thread Eric Blake
doc/posix-headers/limits.texi > @@ -23,6 +23,10 @@ AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1 with gcc. > The macros @code{WORD_BIT}, @code{LONG_BIT} are not defined on some > platforms: > glibc 2.11 without @code{-D_GNU_SOURCE}, Cygwin, mingw, MSVC 9. > @item > +The macro @code{SS

Re: 32-bit glibc bug with SSIZE_MAX

2016-07-13 Thread Paul Eggert
l Eggert Date: Wed, 13 Jul 2016 11:42:40 +0200 Subject: [PATCH] doc: mention glibc SSIZE_MAX buglet * doc/posix-headers/limits.texi (limits.h): Document the bug. --- ChangeLog | 5 + doc/posix-headers/limits.texi | 4 2 files changed, 9 insertions(+) diff --git a/Cha

Re: 32-bit glibc bug with SSIZE_MAX

2016-07-12 Thread Eric Blake
On 07/12/2016 11:06 AM, Eric Blake wrote: > I just tripped up on this glibc bug: > > https://sourceware.org/bugzilla/show_bug.cgi?id=13575 > > where glibc incorrectly defines SSIZE_MAX as a long even though ssize_t > is an int on a 32-bit platform. > > I'm

32-bit glibc bug with SSIZE_MAX

2016-07-12 Thread Eric Blake
I just tripped up on this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=13575 where glibc incorrectly defines SSIZE_MAX as a long even though ssize_t is an int on a 32-bit platform. I'm planning on tweaking gnulib's replacement to work around it in the meantime. --

Re: [bug-gnulib] SSIZE_MAX

2006-06-09 Thread Bruno Haible
to Derek's full-header-path.m4 macro and because I spent a day on that last week-end. > Is that also true for SSIZE_MAX? SSIZE_MAX is expected to be defined in , and #include is portable nowadays. So all we need is a #define SSIZE_MAX ... in config.h on those systems that l

Re: SSIZE_MAX

2006-06-04 Thread Paul Eggert
Ben Pfaff <[EMAIL PROTECTED]> writes: > If ssize_t doesn't exist then I wouldn't expect SSIZE_MAX to > exist either. The current ssize_t module doesn't define > SSIZE_MAX, but, in my opinion, it should. That sounds reasonable, yes. Sorry, I was confused by your earlier messages.

Re: SSIZE_MAX

2006-06-03 Thread Ben Pfaff
> headers on different systems. Is that also true for SSIZE_MAX? > > I don't offhand recall SSIZE_MAX being defined anywhere other than its > standard location . If so, then we wouldn't need a > ssize_max.h header, and we wouldn't need to overload size_max.h; we >

Re: SSIZE_MAX

2006-06-03 Thread Paul Eggert
Ben Pfaff <[EMAIL PROTECTED]> writes: > I really meant ssize_max.h, analogous to size_max.h. Or they > could be combined into one header file. I think size_max.h is there only because SIZE_MAX is in different headers on different systems. Is that also true for SSIZE_MAX? I d

Re: SSIZE_MAX

2006-06-03 Thread Ben Pfaff
Ben Pfaff <[EMAIL PROTECTED]> writes: > Gnulib includes a module for ssize_t, but it doesn't ensure that > SSIZE_MAX is available. It seems that an ssize_t.h header file > with the following contents would be sufficient: I really meant ssize_max.h, analogous to size_max.

SSIZE_MAX

2006-06-03 Thread Ben Pfaff
Gnulib includes a module for ssize_t, but it doesn't ensure that SSIZE_MAX is available. It seems that an ssize_t.h header file with the following contents would be sufficient: #include #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif A few of the s