Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!cca!mirror!datacube!stephen From: stephen@datacube.UUCP Newsgroups: comp.sys.atari.st Subject: Re: MWC problem with 'long int' Message-ID: <105100009@datacube> Date: Thu, 18-Jun-87 12:24:00 EDT Article-I.D.: datacube.105100009 Posted: Thu Jun 18 12:24:00 1987 Date-Received: Mon, 22-Jun-87 02:27:50 EDT References: <752@sask.UUCP> Lines: 36 Nf-ID: #R:sask.UUCP:-75200:datacube:105100009:000:1061 Nf-From: datacube.UUCP!stephen Jun 18 12:24:00 1987 >>From: ubc-vision!alberta!sask!long@beaver.cs.washington.edu (Warren Long) >> >>I have been porting some programs written to run on a SUN system to >>my atari with MWC v.2. I have discovered that: >> >>long int temp1; >>int m; >>------ >>m= anything....; >>temp1 += m; >>------- >>always leaves temp1 = 0; >>and ended up with the same results. Is this an illegal thing to do?? >>I assumed that types would be coersed into the correct thing. This >>works fine on SUN, ULTRIX and UNIX. >This operation is not legal. Wrong. >"if either operand is long ... that is the type of the result" Correct. >Therefor you are assigning a long to an int. Wrong. He is assigning adding an int to a long and then assigning the LONG result to a LONG. Therefore, the originator of this note is correct, his compiler has a blatant bug. Please read a note carefully before giving out incorrect and/or misleading advice. Stephen Watkins UUCP: ihnp4!datacube!stephen Datacube Inc.; 4 Dearborn Rd.; Peabody, Ma. 01960; 617-535-6644