public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* dealing with built-in functions
@ 2007-06-12 22:41 Florian Gleixner
  2007-06-13  9:36 ` Brian Dessent
  2007-06-13  9:57 ` Andrew Haley
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Gleixner @ 2007-06-12 22:41 UTC (permalink / raw)
  To: gcc-help

Hi,

i try to fugure out what is the "best way". The following code throws a
warning:

#include <stdio.h>
#include <math.h>

int main(void)
{
  double x=1.7;
  printf("%f %f",x,round(x));
}

gcc r.c -lm
r.c: In function 'main':
r.c:9: warning: incompatible implicit declaration of built-in function
'round'

I can avoid this by using the compiler switch -fno-builtin. But as far
as i understand, the built in functions are optimized. So if i use
-fno-builtin, i lose some cycles?
I can also put at line 3:
extern double round(double);
and then i don't need the -fno-builtin. But what does that mean? Which
round() do i use then? Can i avoid the warning if i use other types of
variables - i don't know how the built-in round() is defined.
Other thoughts?

Thank you!

Flo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-13 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-12 22:41 dealing with built-in functions Florian Gleixner
2007-06-13  9:36 ` Brian Dessent
2007-06-13 10:00   ` flo
2007-06-13 12:22     ` Brian Dessent
2007-06-13 12:27     ` Andrew Haley
2007-06-13  9:57 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).