avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] strange behaviour with ceil()


From: E. Weddington
Subject: Re: [avr-gcc-list] strange behaviour with ceil()
Date: Thu, 25 Jul 2002 09:18:40 -0600 (Mountain Daylight Time)

I forgot to mention that when you remove the call to ceil(), you don't get an error for the call to sin() because the return value from sin() gets stored in the variable a which then doesn't get used anywhere and is optimized out, hence no more call to sin(), no linker error for sin().
 
Eric
 
-------Original Message-------
 
Date: Wednesday, July 24, 2002 11:43:16 PM
Subject: [avr-gcc-list] strange behaviour with ceil()
 
Hi,

The code below gives errors of
undefined reference to 'sin' and
undefined reference to 'ceil'

When I remove the line:
"m = ceil(a);"

the errors go away but I need to use ceil in my code.
I spent an hour trying to find why this is an error with no luck!
Please help! :)

Here is the code that has an error in it somewhere..:

#include <io.h>
#include <progmem.h>
#include <float.h>
#include <math.h>

int calc()
{
float a;
float m;
a = sin(30);
m = ceil(a);
return m;
}

int main(void)
{
float i;
i = calc();
}




avr-gcc-list at http://avr1.org
.
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]