Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!apple!uokmax!occrsh!att!cbnewsm!gregk From: gregk@cbnewsm.ATT.COM (gregory.p.kochanski) Newsgroups: comp.lang.c++ Subject: Zortech C++ v2.0 Message-ID: <6376@cbnewsm.ATT.COM> Date: 9 Nov 89 13:31:51 GMT References: <5759@spudge.UUCP> Reply-To: gregk@cbnewsm.ATT.COM (gregory.p.kochanski,mh,) Organization: AT&T Bell Laboratories Lines: 38 The following code yeilds the wrong result in zortech C++ 2.0. Note that it is just straight "C". (I have excerpted the interesting section from a longer compiler excerciser). MESS3 should NEVER be printed, and in fact isn't on AT&T C++ 2.0, Microsoft C v5.1, the native Alliant C compiler, and Zortech 1.07. #define MESS3 "CPUTEST FAILS ON LOGICALS\n" main() { register int a; short d, i, *q, **r; register short int *p; long c, l, mm; register unsigned e; double x; float yy; extern short cwords; static float xx; static double y; static long m; static short int b; for(a=0;a<2;a++) { for(b=0;b<2;b++) for(d=0;d<2;d++) for(c=0;c<2;c++) if((a||b)==((!a)&&(!b)) || (!(c&&d))!=((!c)||(!d)) || (!a)==a || ((a!=c)||a)!=((a!=c)||c)) write(2, MESS3, sizeof(MESS3)-1); } exit(0); } Greg Kochanski gpk@physics.att.com Physics for fun and profit. I may be biased, but this is still true.