This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Correct type of SSIZE_MAX for 32-bit (bug 13575)

On Tue, 6 Feb 2018, Florian Weimer wrote:

> On 02/01/2018 09:37 PM, Joseph Myers wrote:
> > +ssize_t x;
> > +extern __typeof (SSIZE_MAX) x;
> Does this assert the equivalence of the types (just like a pointer assignment
> would do)?  Maybe at a comment to that effect?

Yes, this asserts equivalence of types (without any dependence on -Werror, 
incompatible types for the same object produces an unconditional hard 
error).  I've added a comment "Test SSIZE_MAX has type ssize_t.".

> I'm not sure if __WORDSIZE32_SIZE_ULONG is the right condition for that
> because it does not seem to govern the actual definition if size_t/ssize_t,
> but with the compile test to check for consistency, it's good enough, I think.

I think this is already adequately explained in both the patch description 
and the comment

/* ssize_t is not formally required to be the signed type
   corresponding to size_t, but it is for all configurations supported
   by glibc.  */

on the definition of SSIZE_MAX.

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]