All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: paulmck@kernel.org
Cc: linux@weissschuh.net, linux-kernel@vger.kernel.org,
	Willy Tarreau <w@1wt.eu>
Subject: [PATCH 0/4] tools/nolibc: add stdint and more integer types
Date: Sat,  4 Mar 2023 15:26:02 +0100	[thread overview]
Message-ID: <20230304142606.5995-1-w@1wt.eu> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 4663 bytes --]

Hello Paul,

This first series of patches against nolibc is Vincent Dagonneau's final
work with the kind help from Thomas Weißschuh who reviewed it.

It adds stdint, the accompanying types (uint64_t etc) and their limits.
Vincent wrote extensive tests for these limits that were added at the
end of the stdlib test series. What's nice is that the definitions are
mostly based on calculations from the compiler's provided limits while
the tests are made against hard-coded hex values, so this may possibly
help spot unexpected surprises with some uncommon compiler settings (or
even bugs in the printf implementation). And given that it required
several round trips to get to work on all archs, I tend to think that
it's quite sensitive to misconfigurations, which is a nice feature.

Running it on x86_64 gives me this:
  19 limit_int8_max = 127                                          [OK]
  20 limit_int8_min = -128                                         [OK]
  21 limit_uint8_max = 255                                         [OK]
  22 limit_int16_max = 32767                                       [OK]
  23 limit_int16_min = -32768                                      [OK]
  24 limit_uint16_max = 65535                                      [OK]
  25 limit_int32_max = 2147483647                                  [OK]
  26 limit_int32_min = -2147483648                                 [OK]
  27 limit_uint32_max = 4294967295                                 [OK]
  28 limit_int64_max = 9223372036854775807                         [OK]
  29 limit_int64_min = -9223372036854775808                        [OK]
  30 limit_uint64_max = -1                                         [OK]
  31 limit_int_least8_max = 127                                    [OK]
  32 limit_int_least8_min = -128                                   [OK]
  33 limit_uint_least8_max = 255                                   [OK]
  34 limit_int_least16_max = 32767                                 [OK]
  35 limit_int_least16_min = -32768                                [OK]
  36 limit_uint_least16_max = 65535                                [OK]
  37 limit_int_least32_max = 2147483647                            [OK]
  38 limit_int_least32_min = -2147483648                           [OK]
  39 limit_uint_least32_max = 4294967295                           [OK]
  40 limit_int_least64_min = -9223372036854775808                  [OK]
  41 limit_int_least64_max = 9223372036854775807                   [OK]
  42 limit_uint_least64_max = -1                                   [OK]
  43 limit_int_fast8_max = 127                                     [OK]
  44 limit_int_fast8_min = -128                                    [OK]
  45 limit_uint_fast8_max = 255                                    [OK]
  46 limit_int_fast16_min = -9223372036854775808                   [OK]
  47 limit_int_fast16_max = 9223372036854775807                    [OK]
  48 limit_uint_fast16_max = -1                                    [OK]
  49 limit_int_fast32_min = -9223372036854775808                   [OK]
  50 limit_int_fast32_max = 9223372036854775807                    [OK]
  51 limit_uint_fast32_max = -1                                    [OK]
  52 limit_int_fast64_min = -9223372036854775808                   [OK]
  53 limit_int_fast64_max = 9223372036854775807                    [OK]
  54 limit_uint_fast64_max = -1                                    [OK]
  56 limit_intptr_min = -9223372036854775808                       [OK]
  57 limit_intptr_max = 9223372036854775807                        [OK]
  58 limit_uintptr_max = -1                                        [OK]
  59 limit_ptrdiff_min = -9223372036854775808                      [OK]
  60 limit_ptrdiff_max = 9223372036854775807                       [OK]
  61 limit_size_max = -1                                           [OK]

This series was rebased on top of your dev.2023.02.22a branch that was
recently merged into rcu/next. If you want me to rebase it on any other
branch, just let me know. If it could make it for 6.4, it would be great.

Thank you!
Willy

Vincent Dagonneau (4):
  tools/nolibc: add stdint.h
  tools/nolibc: add integer types and integer limit macros
  tools/nolibc: enlarge column width of tests
  tools/nolibc: add tests for the integer limits in stdint.h

 tools/include/nolibc/Makefile                |   4 +-
 tools/include/nolibc/std.h                   |  15 +-
 tools/include/nolibc/stdint.h                |  99 ++++++++++++
 tools/testing/selftests/nolibc/nolibc-test.c | 149 +++++++++++++------
 4 files changed, 203 insertions(+), 64 deletions(-)
 create mode 100644 tools/include/nolibc/stdint.h

-- 
2.17.5


             reply	other threads:[~2023-03-04 14:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04 14:26 Willy Tarreau [this message]
2023-03-04 14:26 ` [PATCH 1/4] tools/nolibc: add stdint.h Willy Tarreau
2023-03-05  0:47   ` Paul E. McKenney
2023-03-05  4:27     ` Willy Tarreau
2023-03-04 14:26 ` [PATCH 2/4] tools/nolibc: add integer types and integer limit macros Willy Tarreau
2023-03-04 14:26 ` [PATCH 3/4] tools/nolibc: enlarge column width of tests Willy Tarreau
2023-03-04 14:26 ` [PATCH 4/4] tools/nolibc: add tests for the integer limits in stdint.h Willy Tarreau

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=20230304142606.5995-1-w@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=paulmck@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.