Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!glacier!Navajo!rokicki From: rokicki@Navajo.ARPA (Tomas Rokicki) Newsgroups: net.micro.amiga Subject: Manx C bug Message-ID: <490@Navajo.ARPA> Date: Thu, 3-Apr-86 18:02:23 EST Article-I.D.: Navajo.490 Posted: Thu Apr 3 18:02:23 1986 Date-Received: Sat, 5-Apr-86 11:18:08 EST Organization: Stanford University Lines: 19 Finally been bitten by a bug in the new compiler. The following code will not work: int test(a, b) int a, b ; { register long t = a * (long) b ; } The (long) coercion is required by the C standard to insure the result is considered a long. This only happens when both arguments are int parameters and a long is required; taking out the coercion yields the proper result in Aztec C. (I don't think it should by the standard C definition, though; an int expression assigned to a long should yield a result with the bits sign-extended). This bug did not happen in over 28,000 lines of C I have compiled and successfully run under Manx C; it only happened when I rewrote one 20-line library routine. Thank God for small favors. -tom