[v3,0/6] Newlib and Cygwin C23 stdbit.h Support

Message ID 20260416210047.2198615-1-joel@rtems.org
Headers
Series Newlib and Cygwin C23 stdbit.h Support |

Message

Joel Sherrill April 16, 2026, 9 p.m. UTC
  Hopefully this is close. I hope it is not a problem to include the
Cygwin changes. I thought it would be easier to review if the
changes were not spread across two mailing lists.

- stdbit/*.c now compiles with -std= gnu99, gnu11, and gnu23.

- cygwin.din updated to include stdbit functions

- rtems/crt0.c: gcc master reported an error on a stub function
  which is now fixed

Joel Sherrill (6):
  newlib/libc: Add C23 stdbit.h from FreeBSD
  Makefile.inc, stdbit/Makefile.inc: Add stdbit
  newlib/Makefile.in: Regenerated
  newlib/libc/stdbit: Make compile for C99 and newer
  libc/sys/rtems/crt0.c: _arc4random_getentropy_fail should not return
  cygwin.din, version.h: Add stdbit.h functions and increment minor

 newlib/Makefile.in                            | 423 +++++++++++++++---
 newlib/libc/Makefile.inc                      |   1 +
 newlib/libc/include/stdbit.h                  | 124 +++++
 newlib/libc/stdbit/Makefile.inc               |  15 +
 newlib/libc/stdbit/stdbit_internal.h          |  47 ++
 newlib/libc/stdbit/stdc_bit_ceil.3            |  81 ++++
 newlib/libc/stdbit/stdc_bit_ceil.c            |  73 +++
 newlib/libc/stdbit/stdc_bit_floor.3           |  83 ++++
 newlib/libc/stdbit/stdc_bit_floor.c           |  55 +++
 newlib/libc/stdbit/stdc_bit_width.3           | 104 +++++
 newlib/libc/stdbit/stdc_bit_width.c           |  55 +++
 newlib/libc/stdbit/stdc_count_ones.3          |  85 ++++
 newlib/libc/stdbit/stdc_count_ones.c          |  40 ++
 newlib/libc/stdbit/stdc_count_zeros.3         |  84 ++++
 newlib/libc/stdbit/stdc_count_zeros.c         |  40 ++
 newlib/libc/stdbit/stdc_first_leading_one.3   |  93 ++++
 newlib/libc/stdbit/stdc_first_leading_one.c   |  59 +++
 newlib/libc/stdbit/stdc_first_leading_zero.3  |  92 ++++
 newlib/libc/stdbit/stdc_first_leading_zero.c  |  59 +++
 newlib/libc/stdbit/stdc_first_trailing_one.3  | 110 +++++
 newlib/libc/stdbit/stdc_first_trailing_one.c  |  54 +++
 newlib/libc/stdbit/stdc_first_trailing_zero.3 |  93 ++++
 newlib/libc/stdbit/stdc_first_trailing_zero.c |  55 +++
 newlib/libc/stdbit/stdc_has_single_bit.3      |  98 ++++
 newlib/libc/stdbit/stdc_has_single_bit.c      |  40 ++
 newlib/libc/stdbit/stdc_leading_ones.3        |  86 ++++
 newlib/libc/stdbit/stdc_leading_ones.c        |  62 +++
 newlib/libc/stdbit/stdc_leading_zeros.3       |  86 ++++
 newlib/libc/stdbit/stdc_leading_zeros.c       |  62 +++
 newlib/libc/stdbit/stdc_trailing_ones.3       |  86 ++++
 newlib/libc/stdbit/stdc_trailing_ones.c       |  58 +++
 newlib/libc/stdbit/stdc_trailing_zeros.3      |  87 ++++
 newlib/libc/stdbit/stdc_trailing_zeros.c      |  58 +++
 newlib/libc/sys/rtems/crt0.c                  |   2 +-
 winsup/cygwin/cygwin.din                      |  70 +++
 winsup/cygwin/include/cygwin/version.h        |   2 +-
 36 files changed, 2651 insertions(+), 71 deletions(-)
 create mode 100644 newlib/libc/include/stdbit.h
 create mode 100644 newlib/libc/stdbit/Makefile.inc
 create mode 100644 newlib/libc/stdbit/stdbit_internal.h
 create mode 100644 newlib/libc/stdbit/stdc_bit_ceil.3
 create mode 100644 newlib/libc/stdbit/stdc_bit_ceil.c
 create mode 100644 newlib/libc/stdbit/stdc_bit_floor.3
 create mode 100644 newlib/libc/stdbit/stdc_bit_floor.c
 create mode 100644 newlib/libc/stdbit/stdc_bit_width.3
 create mode 100644 newlib/libc/stdbit/stdc_bit_width.c
 create mode 100644 newlib/libc/stdbit/stdc_count_ones.3
 create mode 100644 newlib/libc/stdbit/stdc_count_ones.c
 create mode 100644 newlib/libc/stdbit/stdc_count_zeros.3
 create mode 100644 newlib/libc/stdbit/stdc_count_zeros.c
 create mode 100644 newlib/libc/stdbit/stdc_first_leading_one.3
 create mode 100644 newlib/libc/stdbit/stdc_first_leading_one.c
 create mode 100644 newlib/libc/stdbit/stdc_first_leading_zero.3
 create mode 100644 newlib/libc/stdbit/stdc_first_leading_zero.c
 create mode 100644 newlib/libc/stdbit/stdc_first_trailing_one.3
 create mode 100644 newlib/libc/stdbit/stdc_first_trailing_one.c
 create mode 100644 newlib/libc/stdbit/stdc_first_trailing_zero.3
 create mode 100644 newlib/libc/stdbit/stdc_first_trailing_zero.c
 create mode 100644 newlib/libc/stdbit/stdc_has_single_bit.3
 create mode 100644 newlib/libc/stdbit/stdc_has_single_bit.c
 create mode 100644 newlib/libc/stdbit/stdc_leading_ones.3
 create mode 100644 newlib/libc/stdbit/stdc_leading_ones.c
 create mode 100644 newlib/libc/stdbit/stdc_leading_zeros.3
 create mode 100644 newlib/libc/stdbit/stdc_leading_zeros.c
 create mode 100644 newlib/libc/stdbit/stdc_trailing_ones.3
 create mode 100644 newlib/libc/stdbit/stdc_trailing_ones.c
 create mode 100644 newlib/libc/stdbit/stdc_trailing_zeros.3
 create mode 100644 newlib/libc/stdbit/stdc_trailing_zeros.c
  

Comments

Corinna Vinschen April 17, 2026, 11:57 a.m. UTC | #1
On Apr 16 16:00, Joel Sherrill wrote:
> Hopefully this is close. I hope it is not a problem to include the
> Cygwin changes. I thought it would be easier to review if the
> changes were not spread across two mailing lists.
> 
> - stdbit/*.c now compiles with -std= gnu99, gnu11, and gnu23.
> 
> - cygwin.din updated to include stdbit functions
> 
> - rtems/crt0.c: gcc master reported an error on a stub function
>   which is now fixed
> 
> Joel Sherrill (6):
>   newlib/libc: Add C23 stdbit.h from FreeBSD
>   Makefile.inc, stdbit/Makefile.inc: Add stdbit
>   newlib/Makefile.in: Regenerated
>   newlib/libc/stdbit: Make compile for C99 and newer
>   libc/sys/rtems/crt0.c: _arc4random_getentropy_fail should not return
>   cygwin.din, version.h: Add stdbit.h functions and increment minor

Pushed, except patch 5, which should be handled separately.

Thanks,
Corinna