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: Bruno Haible
Subject: Re: stdbool module unconditionally #define true
Date: Fri, 14 Oct 2022 21:23:27 +0200

Simon Josefsson wrote:
> rlogind.c: In function 'rlogind_mainloop':
> rlogind.c:1112:7: error: expected identifier or '(' before numeric constant
>  1112 |   int true;
>       |       ^~~~
> 
> The file does not include stdbool.h.  ...
> 
> Does C23 disallow this?

Yes. C23 ยง 6.4.1 states that true and false are now keywords. This precludes
the use as variable names.

So, that source code will need to change to conform to C23.

With Gnulib, you can opt to avoid the 'stdbool' module and use 'stdbool-c99'.
This will avoid this compilation error in rlogind.c, but many Gnulib modules
will not compile in this setting.

Bruno






reply via email to

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