public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph-gcc@littlepinkcloud.COM>
To: flo@redflo.de
Cc: gcc-help@gcc.gnu.org
Subject: Re: dealing with built-in functions
Date: Wed, 13 Jun 2007 12:27:00 -0000	[thread overview]
Message-ID: <18031.49175.192836.370113@zebedee.pink> (raw)
In-Reply-To: <466FBBA5.9060702@redflo.de>

flo@redflo.de writes:
 > Brian Dessent schrieb:
 > > Florian Gleixner wrote:
 > > 
 > >> gcc r.c -lm
 > >> r.c: In function 'main':
 > >> r.c:9: warning: incompatible implicit declaration of built-in function
 > >> 'round'
 > > 
 > > I'm assuming that your C library is glibc, i.e. you're using Linux.  It
 > > is always a good idea to state what platform you are using, because gcc
 > > supports many dozens of platforms so don't assume we know what you're
 > > using.
 > > 
 > 
 > Good guess. I will be more verbose next time.
 > 
 > > The problem you are seeing is that glibc has a number of feature levels
 > > that it supports.  By default, it only exposes a fraction of available
 > > features (C90) in its headers.  You have to explicitly define the level
 > > of feature support that you want:
 > > <http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html>. 
 > > Defining _GNU_SOURCE gets you everything and is the most commonly used,
 > > e.g. by adding -D_GNU_SOURCE to CFLAGS.  I think that if you use
 > > autoconf, it takes care of this for you if it detects you're on a glibc
 > > system, but I could be wrong.
 > 
 > Autoconf did not help me here automatically. But maybe i have to change
 > something in configure.ac?
 > So what is the "right way"? 

It depends on what you want.  If you want to use Standard C (1999
version), use std=c99.  If you want GNU extensions, use GNU_SOURCE.

Andrew.

  parent reply	other threads:[~2007-06-13 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 22:41 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 [this message]
2007-06-13  9:57 ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18031.49175.192836.370113@zebedee.pink \
    --to=aph-gcc@littlepinkcloud.com \
    --cc=flo@redflo.de \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).