bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C23 vs NCURSES_BOOL


From: Thomas Dickey
Subject: Re: C23 vs NCURSES_BOOL
Date: Sun, 17 Nov 2024 06:02:55 -0500

On Sun, Nov 17, 2024 at 04:43:50AM +0000, Sam James wrote:
> Hi,
> 
> Upcoming GCC 15 defaults to -std=gnu23 as of yesterday.
...
> It looks like if stdbool.h isn't required, we end up assuming
> that a native bool isn't actually available at all, but this isn't the
> case in C23 where bool is natively available (and is actually the same
> as _Bool) without any headers.

That means ncurses will need configure checks to cover the new case
(stdbool.h available but not actually needed),
without breaking the existing ones :-)

> I noticed this when looking at a build failure with ncurses where our
> packaging QA checks noticed the installed headers differed for the
> 32-bit and 64-bit multilib builds as:
> """
> $ diff -u 
> /var/tmp/portage/sys-libs/ncurses-6.5_p20241109/work/ncurses-6.5-abi_x86_32.x86/ncursest/include/curses.h
>  
> /var/tmp/portage/sys-libs/ncurses-6.5_p20241109/work/ncurses-6.5-abi_x86_64.amd64/ncursest/include/curses.h
> --- 
> /var/tmp/portage/sys-libs/ncurses-6.5_p20241109/work/ncurses-6.5-abi_x86_32.x86/ncursest/include/curses.h
>    2024-11-17 04:23:22.358220380 +0000
> +++ 
> /var/tmp/portage/sys-libs/ncurses-6.5_p20241109/work/ncurses-6.5-abi_x86_64.amd64/ncursest/include/curses.h
>  2024-11-17 04:24:51.531137819 +0000
> @@ -283,7 +283,7 @@
>  #undef FALSE
>  #define FALSE   0
> 
> -typedef char NCURSES_BOOL;
> +typedef int NCURSES_BOOL;
> 
>  #if 0  /* __cplusplus, etc. */
> """
> 
> It might be that I'm barking up the wrong tree here, but the copy on my
> system is 'typedef unsigned char NCURSES_BOOL' before rebuilding with
> C23.
> 
> It also seems like this manifests in a build failure of the C++ bindings
> if enabled too.
> 
> Does this make sense or am I going in the wrong direction here?

yes...

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]