From: Weiqi Gao Newsgroups: comp.os.msdos.djgpp Subject: Re: enum - Why does true == false? Date: Thu, 16 Sep 1999 23:31:37 -0500 Organization: CRL Network Services Lines: 28 Message-ID: <37E1C429.FA787217@a.crl.com> References: NNTP-Posting-Host: a116002.stl1.as.crl.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i586) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Carl Hover wrote: > > Why does this program print "true == false" when compiled with djgpp > v2.01, and "true != false" when compiled with Borland C++ 3.1? Are > enum constants ill-defined during preprocessing? See K&R p.232, l.-11. > #include > > int main(void) > { > enum {false, true}; > > #if true == false > printf("true == false\n"); > #endif > > #if true != false > printf("true != false\n"); > #endif > > return 0; > } -- Weiqi Gao weiqigao AT a DOT crl DOT com