delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/31/07:15:45

Subject: Re: Patches for building with gcc 3.1 - tests chunk
From: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
To: djgpp-workers AT delorie DOT com
In-Reply-To: <200205310919.LAA13003@lws256.lu.erisoft.se>
References: <200205310919 DOT LAA13003 AT lws256 DOT lu DOT erisoft DOT se>
X-Mailer: Ximian Evolution 1.0.5
Date: 31 May 2002 12:34:16 +0200
Message-Id: <1022841257.28101.2.camel@bender.falconsoft.be>
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, 2002-05-31 at 11:19, Martin Stromberg wrote:
> Eli said:
> > What warning is that, exactly?  (I didn't yet install GCC 3.1.)
> 
> Richard's mail dated Sun, 26 May 2002 17:00:53 +0100:
> tests/libc/go32/signals.c: The following line:
> 
>     urand = ((double)rand()) / RAND_MAX;
> 
> [snip]
> 
> assignment is an expression.) In this case we explicitly want to
> convert to double. How to do that? Umm... Let's see... Perhaps we
> should cast it?! 

Wouldn't
	urand = (rand() * 1.0) / RAND_MAX;
work around the warning?  Or does C promote to float instead of double?


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019