Re: [PATCH 5/7] Define LLONG_MAX/MIN etc if not already defined.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 May 2020 at 20:24, Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:
> On Mai 18 2020, Darren Tucker wrote:
[...]
> > +#define SIZE_MAX ((size_t)maximum_signed_value_of_type(size_t))
>
> size_t is an unsigned type.

indeed; missed that in my cut and pasting.

[...]
> These definitions won't work in the preprocessor.  The are no current
> uses of these macros in preprocessor directives, but that needs to be
> kept in mind.

I originally had these defined to LONG_LONG_MAX and ULONG_LONG_MAX
which it (HP-UX 11.11) has.  It's also got SSIZE_MAX but not SIZE_MAX,
so I originally had

#if !defined(SIZE_MAX) && defined(SSIZE_MAX) && (SSIZE_MAX == LONG_MAX)
# define SIZE_MAX ULONG_MAX
#endif

which would work in macros, but I changed it at the last minute to use
those other macros since it seemed more likely to work on any other
systems that had this problem.

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux