bug-gnulib
[Top][All Lists]
Advanced

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

Re: stdbool module unconditionally #define true


From: Paul Eggert
Subject: Re: stdbool module unconditionally #define true
Date: Fri, 14 Oct 2022 15:27:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 2022-10-14 14:08, Simon Josefsson via Gnulib discussion list wrote:
Shouldn't the following cause a compilation error?

$ podman run -it gcc:latest
root@18544d251872:/# cat>foo.c
int main (void) {
int true = 42;
return true;
}

Yes if you have a C23 compiler, which GCC 12 isn't. To get a proper compilation error you will have to wait for a future GCC release, unless you are using bleeding-edge GCC. Support for the keywords bool, true and false was added in GCC commit 0a91bdaf177409a2a5e7895bce4f0e7091b4b3ca dated 2022-09-07.

That GCC commit also added support for the C23 keywords alignas, alignof, static_assert, and thread_local, where you may see similar issues.



reply via email to

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