Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Why _Bool was not defined as enum in C99? Date: Wed, 14 Sep 2016 20:45:39 -0700 Organization: None to speak of Lines: 19 Message-ID: References: <6b5aa241-0498-4e41-993b-a1ed445effb0@googlegroups.com> <02a1a24e-5ead-486c-8397-e68a2a79f8f7@googlegroups.com> <8760pynx50.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="17156"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Fsz+Vq09eGs/FSQiiBAvT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:KJUSfPlIfAer/bodr8R3oFehC1c= sha1:OQ3kMHmlJRspQtKO15w/xnFy0z0= Xref: csiph.com comp.lang.c:93515 supercat@casperkitty.com writes: > On Wednesday, September 14, 2016 at 4:34:30 PM UTC-5, Keith Thompson wrote: >> Programmers should use _Bool or bool because it's substantially clearer >> than using unsigned char to represent a true/false condition. > > What's the advantage of using a less-efficient type versus a user-defined > "flag" type could allow more efficient code generation? I already answered that. See above. If using unsigned char makes the code *significantly* and *measurably* faster, by all means use it (and perhaps consider complaining to your compiler vendor). -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"