Date: Thu, 21 Nov 1996 08:47:35 +0200 (IST) From: Eli Zaretskii To: Mad Cc: djgpp AT delorie DOT com Subject: Re: Problems with djgpp 2.01 In-Reply-To: <01bbd6f0$f0f67780$a40141c2@warzone.telepac.pt> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 20 Nov 1996, Mad wrote: > > i just downloaded djgpp version 2.01 and i'm having problem with the > rand() function which always assigns 0 (zero) to my variable. For instance: > > > int main (void) > { int x; > > x=rand(); > return (0); > } > > will always assign me 0 to x. Is anyone else haveing the same problem or am > i the only one? If you compile this very program, gcc might see that x is never used and silently optimize it away. Try adding a `printf' statement that prints the value, or put it into the return statement, and then see if it works.