Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!hplabs!well!ewhac From: ewhac@well.UUCP Newsgroups: comp.sys.amiga Subject: Re: Is this a Manx Bug? Message-ID: <2522@well.UUCP> Date: Mon, 2-Feb-87 03:55:42 EST Article-I.D.: well.2522 Posted: Mon Feb 2 03:55:42 1987 Date-Received: Tue, 3-Feb-87 04:02:35 EST References: <958@tekred.TEK.COM> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 28 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 Wrongo. To wit: -------- The C Programming Language, Kernighan & Ritchie, p. 82: "In the absence of explicit initialization, external and static variables are guaranteed to be initialized to zero; automatic and register variables have undefined (i.e. garbage) values." -------- _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab ihnp4!ptsfa!well!ewhac The Guy in The Cape ..or.. well ---\ "Work FOR? I don't work FOR dual ----> !unicom!ewhac anybody. I'm just having fun." hplabs -/ ("AE-wack")