All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] tools/nolibc: add stdint and more integer types
@ 2023-03-04 14:26 Willy Tarreau
  2023-03-04 14:26 ` [PATCH 1/4] tools/nolibc: add stdint.h Willy Tarreau
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Willy Tarreau @ 2023-03-04 14:26 UTC (permalink / raw)
  To: paulmck; +Cc: linux, linux-kernel, Willy Tarreau

[-- 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-05  4:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-04 14:26 [PATCH 0/4] tools/nolibc: add stdint and more integer types Willy Tarreau
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

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.