bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH 1/6] limits-h: add BOOL_MAX, BOOL_WIDTH
Date: Sun, 01 Aug 2021 15:38:26 +0200	[thread overview]
Message-ID: <1708690.xt3HgqXhSV@omega> (raw)
In-Reply-To: <20210731190124.279622-1-eggert@cs.ucla.edu>

> +	limits-h: add BOOL_MAX, BOOL_WIDTH

2021-08-01  Bruno Haible  <bruno@clisp.org>

	limits-h tests: Add tests for BOOL_MAX and BOOL_WIDTH.
	* tests/test-limits-h.c (bool_attrs): New variable.
	Check value of BOOL_MAX.

diff --git a/tests/test-limits-h.c b/tests/test-limits-h.c
index 4144013..f3394c1 100644
--- a/tests/test-limits-h.c
+++ b/tests/test-limits-h.c
@@ -110,6 +110,11 @@ verify_width (ULONG_WIDTH, 0, ULONG_MAX);
 verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX);
 verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
 
+/* Macros specified by C2x.  */
+
+int bool_attrs[] = { BOOL_MAX, BOOL_WIDTH };
+verify (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
+
 int
 main (void)
 {



      parent reply	other threads:[~2021-08-01 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-31 19:01 [PATCH 1/6] limits-h: add BOOL_MAX, BOOL_WIDTH Paul Eggert
2021-07-31 19:01 ` [PATCH 2/6] manywarnings: document GCC 11 warnings Paul Eggert
2021-07-31 19:01 ` [PATCH 3/6] gnulib-common: update for C2x 2020-12-11 draft Paul Eggert
2021-07-31 19:01 ` [PATCH 4/6] gnulib-common: update for gcc -Wmismatched-dealloc Paul Eggert
2021-07-31 19:01 ` [PATCH 5/6] xalloc: add malloc-related function attributes Paul Eggert
2021-07-31 19:01 ` [PATCH 6/6] doc: C2X -> C2x Paul Eggert
2021-08-01 13:38 ` Bruno Haible [this message]

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=1708690.xt3HgqXhSV@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).