Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ucla-cs!sdcrdcf!usc-oberon!bacall!papa From: papa@bacall.UUCP Newsgroups: comp.sys.amiga Subject: Re: Is this a Manx Bug? Message-ID: <2271@bacall.UUCP> Date: Sun, 1-Feb-87 00:44:55 EST Article-I.D.: bacall.2271 Posted: Sun Feb 1 00:44:55 1987 Date-Received: Sun, 8-Feb-87 00:39:24 EST References: <958@tekred.TEK.COM> Organization: CS&CE Depts, U.S.C., Los Angeles, CA Lines: 23 >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? > Sorry to say, but you are wrong and MANX is right. I quote from the "C" bible (I mean K&R, p. 198): "Static and external variables which are not initialized are guaranteed to start off at 0; automatic and register variables which are not initialized ^^^^^^^^^ are guaranteeed to start off as garbage". ^^^^^^^ Also note that there isn't such a thing as UNIX C (which UNIX? version 7, System V, 4.2. 4.3?). Maybe you meant pcc (the portable C compiler)? -- Marco Papa Felsina Software