This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 3.4.4 vs 3.2.5 ; fabs: cant use as a function..
- From: corey taylor <corey dot taylor at gmail dot com>
- To: Ming-Xiang Fu <deadly at cmlab dot csie dot ntu dot edu dot tw>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 27 Jul 2005 23:54:50 -0500
- Subject: Re: 3.4.4 vs 3.2.5 ; fabs: cant use as a function..
- References: <20050728041558.M68708@cmlab.csie.ntu.edu.tw>
- Reply-to: corey taylor <corey dot taylor at gmail dot com>
Hi Fu,
The code you attached doesn't show an include of cmath, but I assume
that you did try it.
What happens when you explicitly call std::fabs ?
corey
On 7/27/05, Ming-Xiang Fu <deadly@cmlab.csie.ntu.edu.tw> wrote:
>
>
> hi, I am having some problem to compile a code by gcc 3.4.4 which is
> successfully compiled in gcc 3.2.5.
>
>
> At the begining, it complains about abs(float) is ambiguous..and sin(), cos()
> not declares.
>
> And then, I include <cmath>, resolve some problem, and new problem occurs.
>
> " ` fabs' cannot be used as a function "
>
>
>
> please give me some guide, I will be appreciate about that.
> Thanks anyway. :)
>
>
> RedMo
> part of src code as below.
>
> ------------------------------------------------------------------------------------------------------------------------------------
>
> // GlobalObject.cpp: implementation of the CGlobalObject class.
> //
> //////////////////////////////////////////////////////////////////////
>
> #include "GlobalObject.h"
> #include <iomanip>
> #include <math.h>
> #include "../../Node/DEBUG.H"
>
> using namespace std;
>
> void VsMathObject::Evaluate(int member, VsValue& value, VsExprList &args,
> VsFunctionCall *parent)
> {
>
> switch(member)
> {
>
> case fabs:
> value.SetNumber( fabs(arg0.GetNumber()) );
> // arg0.GetNumber() returns a float number.
> break;
> case ffabs:
> value.SetNumber( fabs(arg0.GetNumber()) );
> break;
> case facos:
> value.SetNumber( acos(arg0.GetNumber()) );
> break;
> case fasin:
> value.SetNumber( asin(arg0.GetNumber()) );
> break;
>
> default:
> ASSERT(false);
> }
> }
>
> ---------------------------------------------------------------------------------------------------------------------------
>
>
>
>
>
> --
> Communication and Multimedia Laboratory
> Dept. of Computer Science and Information Engineering, NTU
>
>
>
>