delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/31/10:04:49

From: Martin Stromberg <eplmst AT epl DOT ericsson DOT se>
Message-Id: <200205311345.PAA13286@lws256.lu.erisoft.se>
Subject: Re: Patches for building with gcc 3.1 - tests chunk
To: djgpp-workers AT delorie DOT com
Date: Fri, 31 May 2002 15:45:33 +0200 (MET DST)
In-Reply-To: <3CF7578A.2C2ADFE1@yahoo.com> from "CBFalconer" at May 31, 2002 06:59:22 AM
X-Mailer: ELM [version 2.5 PL3]
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

> 
> Martin Stromberg wrote:
> > 
> > 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;
> > 
> > gives this warning:
> > 
> > gcc @../../gcc.opt -I. -I- -I../../../include  -pg -c signals.c
> > cc1.exe: warnings being treated as errors
> > signals.c: In function `int_handler':
> > signals.c:23: warning: cast does not match function type
> > 
> ... snip ...
> > 
> > But, surely this is another useless one. When did casting from int to
> > double become a non-matching type? C is defined to convert integer
> > types to floating point types if the expression contains a mix. (An
> > 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?!
> 
> It converts a double expression to int (if urand is integral).

Sorry. I didn't post this information:

double urand;


Right,

						MartinS

- Raw text -


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