Xref: utzoo comp.lang.c++:5016 comp.lang.c:22729 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond From: diamond@csl.sony.co.jp (Norman Diamond) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Time to standardize "true" and "false" Message-ID: <10890@riks.csl.sony.co.jp> Date: 29 Sep 89 04:17:18 GMT References: <12070@cit-vax.Caltech.Edu> <8862@etana.tut.fi> Reply-To: diamond@riks. (Norman Diamond) Followup-To: comp.lang.c++ Organization: Sony Computer Science Laboratory Inc., Tokyo, Japan Lines: 20 From article <12070@cit-vax.Caltech.Edu>, by wen-king@cit-vax.Caltech.Edu (King Su): >> #define bool(a) (!!(a)) >> Then just use bool(X) whenever you wanted to use (bool)X. In article <8862@etana.tut.fi> pl@etana.tut.fi (Lehtinen Pertti) writes: > Then suddenly just behind the corner comes C-compiler from > ACME-corporation and realizes '!!a' -> negation of negation is > same as original -> we can optimize it away. Actually no. If the optimizer reduces this to a no-op without knowing that "a" must already be 0 or 1, then the optimizer is broken. "!" was required to produce a result of 0 or 1 even before K&R-1. -- Norman Diamond, Sony Corporation (diamond@ws.sony.junet) The above opinions are inherited by your machine's init process (pid 1), after being disowned and orphaned. However, if you see this at Waterloo or Anterior, then their administrators must have approved of these opinions.