From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,b874762b96c8fc75 X-Google-Attributes: gid111c93,public From: Bill Zettler Subject: Re: Problems with C on Alpha Date: 1999/09/13 Message-ID: <37DCAEDD.AF41CD7@zettler.com>#1/1 X-Deja-AN: 524371279 Content-Transfer-Encoding: 7bit References: <37DC9806.8AFA2F70@ihg.uni-duisburg.de> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 937209571 207.104.3.3 (Mon, 13 Sep 1999 00:59:31 PDT) Organization: Bill Zettler Consulting MIME-Version: 1.0 NNTP-Posting-Date: Mon, 13 Sep 1999 00:59:31 PDT Newsgroups: comp.os.linux.alpha What the hey? You didn't initialize the variable! It has nothing useful in it. Maybe a compiler set for maximal debugging will automatically initialize your automatics to 0, but you're certainly not guaranteed it in general. Most compilers will give you an error message at this code, because you used a variable before it was set. Why wouldn't a compiler always set all the automatics to 0? Because it takes time! Time that could murder a speed-critical function. So they let you initialize your own darn variables to whatever you want. Hope this helps, Bill Heiko Ronsdorf wrote: > This program ( simplified ) runs fine under i386 ( Linux 2.2.12, gcc > 2.7), > but it won't work on alpha ( Digital UNIX 4.0a, some cc )? > > main(argc, argv) > int argc; > char *argv; > { > int a; > if ( a ) then > printf(" a is true! \n"); > } > > Why is a not false? > > Thanks for all answers