Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!cbmvax!higgin From: higgin@cbmvax.UUCP Newsgroups: comp.sys.amiga Subject: Re: Is this a Manx Bug? Message-ID: <1319@cbmvax.cbmvax.cbm.UUCP> Date: Sat, 31-Jan-87 09:30:19 EST Article-I.D.: cbmvax.1319 Posted: Sat Jan 31 09:30:19 1987 Date-Received: Sat, 31-Jan-87 20:00:28 EST References: <958@tekred.TEK.COM> Reply-To: higgin@cbmvax.UUCP (Paul Higginbottom GUEST) Organization: PDH, Inc. Lines: 29 Keywords: auto variables In article <958@tekred.TEK.COM> joels@tekred.TEK.COM (Joel Swank) writes: $ $I recently ported a UNIX program to the Amiga. All went well execpt for $one GURU that was caused by an index that was not initialized to zero $at every entry to a subroutine. I put in an 'i=0;' and fixed it. $later I was reading my C manual and it said that all 'auto' variables $should be automaticly initialized to zero at every entry to the subroutine. $The UNIX C does this, but Manx does not. Is this a Manx bug? $ $Joel Swank $Tektronix, Redmond, Oregon I don't know what C manual you have, but I've never read anywhere that automatic variables are initialized. They're created on the stack and if you have any big automatic variables on the stack, that's going to be a LOT of overhead on each call to the function just to zero the memory used for auto variables. But anyway, no, Manx code DEFINITELY does not automatically initialize variables to 0. Maybe for int's etc it wouldn't be too hard to do this, but Joel, if you had auto floats and doubles, it would have to put the appropriate floating point representations of zero onto the stack rather than just flush it wish zeroes (ick). Hope this helps, Paul. Disclaimer: I still work for myself (until Monday) and my opinions are still just my own.