delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/27/22:32:40

Sender: nate AT cartsys DOT com
Message-ID: <35E60E4E.9926FD6F@cartsys.com>
Date: Thu, 27 Aug 1998 18:56:30 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Siddiqui <siddiqui AT dircon DOT co DOT uk>
CC: djgpp AT delorie DOT com
Subject: Re: type mismatch problem
References: <35e5bc22 DOT 0 AT newsread1 DOT dircon DOT co DOT uk>

Siddiqui wrote:
> 
> I'm using allegro to do a little rendering type of thing, but gcc warns me:
> 
> "Warning:  type mismatch in implicit declaration
>                    for built-in function `sqrt' "
> 
> and
> 
> "Warning:  type mismatch in implicit
>                    declaration for built-in function `cos' "
> 
> It is refering to my use of the sqrt and cos. It warns me well intentonaly
> :) bcause my program crashes. The code is wrtten below:

You need to #include <math.h>, which declares `sqrt', `cos' and the
like.  Otherwise, they default to functions returning int, which is
clearly wrong.
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


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