[Bug libc/13575] SSIZE_MAX defined as LONG_MAX is inconsistent with ssize_t, when __WORDSIZE != 64

fweimer at redhat dot com sourceware-bugzilla@sourceware.org
Wed Jul 13 13:32:00 GMT 2016


https://sourceware.org/bugzilla/show_bug.cgi?id=13575

--- Comment #9 from Florian Weimer <fweimer at redhat dot com> ---
Oh, okay.

I tried this program:

#include <limits.h>
#include <stdint.h>
#include <stdio.h>

#include <typeinfo>

int
main (void)
{
  puts (typeid (size_t).name());
  puts (typeid (SIZE_MAX).name());
  puts (typeid (ssize_t).name());
  puts (typeid (SSIZE_MAX).name());
}

On s390 (32-bit), it currently prints:

m
j
l
l

This corresponds to:

unsigned long
unsigned int
long
long

So SIZE_MAX already has the wrong type, and with your proposed change,
SSIZE_MAX would have the wrong type as well.

I think the best approach would be to define the maximum along with
__SSIZE_T_TYPE.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list