Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Bill Zettler <bzettler@zettler.com>
Subject: Re: Problems with C on Alpha
Date: 1999/09/13	[thread overview]
Message-ID: <37DCAEDD.AF41CD7@zettler.com> (raw)
In-Reply-To: 37DC9806.8AFA2F70@ihg.uni-duisburg.de

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




      reply	other threads:[~1999-09-13  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-13  4:00 Problems with C on Alpha Heiko Ronsdorf
1999-09-13  4:00 ` Bill Zettler [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox