All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Darren Tucker <dtucker@dtucker.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/7] Define LLONG_MAX/MIN etc if not already defined.
Date: Mon, 18 May 2020 12:24:00 +0200	[thread overview]
Message-ID: <87a725r16n.fsf@igel.home> (raw)
In-Reply-To: <20200518100356.29292-5-dtucker@dtucker.net> (Darren Tucker's message of "Mon, 18 May 2020 20:03:54 +1000")

On Mai 18 2020, Darren Tucker wrote:

> diff --git a/git-compat-util.h b/git-compat-util.h
> index 8ba576e81e..aa221eba1b 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -127,6 +127,22 @@
>  /* Approximation of the length of the decimal representation of this type. */
>  #define decimal_length(x)	((int)(sizeof(x) * 2.56 + 0.5) + 1)
>  
> +#ifndef SIZE_MAX
> +#define SIZE_MAX ((size_t)maximum_signed_value_of_type(size_t))

size_t is an unsigned type.

> +#endif
> +
> +#ifndef LLONG_MIN
> +#define LLONG_MIN ((long long)minimum_signed_value_of_type(long long))
> +#endif
> +
> +#ifndef LLONG_MAX
> +#define LLONG_MAX ((long long)maximum_signed_value_of_type(long long))
> +#endif
> +
> +#ifndef ULLONG_MAX
> +#define ULLONG_MAX ((unsigned long long)maximum_unsigned_value_of_type(unsigned long long))
> +#endif

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.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2020-05-18 10:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 10:03 [PATCH 1/7] Redirect grep's stderr top null too Darren Tucker
2020-05-18 10:03 ` [PATCH 2/7] Define NO_PREAD for HPUX 11.11 and 11.00 Darren Tucker
2020-05-18 10:03 ` [PATCH 3/7] Test for strtoull in configure Darren Tucker
2020-05-18 10:03 ` [PATCH 4/7] Use strtoumax instead of strtoull Darren Tucker
2020-05-18 18:29   ` Junio C Hamano
2020-05-18 10:03 ` [PATCH 5/7] Define LLONG_MAX/MIN etc if not already defined Darren Tucker
2020-05-18 10:24   ` Andreas Schwab [this message]
2020-05-18 14:41     ` Darren Tucker
2020-05-18 10:03 ` [PATCH 6/7] Check if strtoumax is a macro (eg HP-UX 11.11) Darren Tucker
2020-05-18 17:17   ` Junio C Hamano
2020-05-20  1:49     ` Darren Tucker
2020-05-20  3:19       ` Junio C Hamano
2020-05-18 10:03 ` [PATCH 7/7] Define SCNuMAX if not already defined Darren Tucker
2020-05-18 14:13 ` [PATCH 1/7] Redirect grep's stderr top null too Đoàn Trần Công Danh
2020-05-18 14:29   ` Darren Tucker
2020-05-18 15:30     ` Đoàn Trần Công Danh
2020-05-18 23:22       ` Darren Tucker
2020-05-19  0:56         ` [PATCH] t5703: replace "grep -a" usage by perl Đoàn Trần Công Danh
2020-05-19  2:22           ` Darren Tucker
2020-05-19  7:13           ` Christian Couder
2020-05-19 11:39             ` Đoàn Trần Công Danh
2020-05-19 14:13               ` Christian Couder
2020-05-19 16:09       ` [PATCH 1/7] Redirect grep's stderr top null too Eric Sunshine
2020-05-18 18:20 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a725r16n.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=dtucker@dtucker.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.