Re: [PATCH v2 0/2] Add C23 stdbit.h functionality
Brian Inglis <[email protected]> Fri, 17 Apr 2026 23:17:59 -0600
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Organization | Systematic Software |
| Message-ID | <[email protected]> |
On 2026-04-16 14:55, Joel Sherrill wrote:
> On Mon, Apr 13, 2026 at 5:51 AM Corinna Vinschen wrote:
> The new files in the stdbit subdir don't build on Cygwin, because you're
> including limits.h without defining __STDC_WANT_IEC_60559_BFP_EXT__.
> This will only work if you set __ISO_C_VISIBLE >= 2023, which is NOT the
> default when building newlib. You have to make sure this stuff builds
> even if __ISO_C_VISIBLE >= 2023 is NOT defined while building newlib.
>
> Next, these functions would be better also defined as macros in
> stdbit.h, so the (in all cases trivial) functionality would be inlined
> rather than adding the function calling overhead.
>
> The implementation is unmodified from FreeBSD. I don't see the value
> of deviating from their implementation at this time. If someone wants to
> do that, OK but we cannot just copy it from glibc.
>
> Also if you end up with all macros and inline functions, wouldn't that
> make it impossible to export them?
FreeBSD may be assuming using whatever their current compilers are and which
will automatically inline trivial leaf functions of this sort, whereas newlib
and your build variants can not usually assume much compiler capability nor much
memory available on targets.
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry