Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Is bool no longer a primitive data type of C/C++ ? Date: Mon, 02 Nov 2020 16:05:21 -0800 Organization: None to speak of Lines: 18 Message-ID: <87lffjs3su.fsf@nosuchdomain.example.com> References: <1btuu7bstx.fsf@pfeifferfamily.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="7434a297a97e7f7cda6fff7078b4a493"; logging-data="8595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185H7kJkoIzVTrqLslNr2Pp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:Vwu205ZCZX3d6enAkTxd8I9jY/k= sha1:MxE1snhRwv8ox2AYJFFyNTOuqe0= Xref: csiph.com comp.lang.c:156401 comp.lang.c++:76805 David Brown writes: > "bool", "true" and "false" are valid identifiers in C, and so making > them keywords in C99 would have broken existing code. (C++ had them as > keywords since the language was created - also, C++ is more willing to > risk breakage in existing code than C is in new standards.) [...] That's not quite true. C++ has had bool as a builtin type, and false and true as keywords, since its first ISO standard, in 1998. But the first and second editions of Stroustrup's "The C Programming Language" (1986 and 1991, respectively) don't mention bool, and for example document that the "!" operator yields a result of type int with the value 0 or 1. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */