Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!rutgers!att!cbnews!lvc From: lvc@cbnews.ATT.COM (Lawrence V. Cipriani) Newsgroups: comp.lang.c Subject: Yet another pcc botch Keywords: Compiler bugs Message-ID: <3310@cbnews.ATT.COM> Date: 20 Jan 89 13:32:29 GMT Organization: AT&T Bell Laboratories Lines: 31 This program demonstrates a bug that is in some versions of pcc: main() { float f, g; unsigned short u, v; short s, t; u = 250; s = 250; t = 100; v = 100; f = t - s; g = v - u; printf("f = %f, g = %f\n", f, g); } When compiled and executed the output is: f = -150.000000, g = 65386.000000 The correct value for g is -150.000000. This bug is *not* present in the cc that comes with SVR3 from AT&T. It is present in SVR2 for VAX and 3B20. -- Larry Cipriani, AT&T Network Systems, Columbus OH, Path: att!cbnews!lvc Domain: lvc@cbnews.ATT.COM