public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <wilson@cygnus.com>
To: Christian Joensson FOA 72 <chj@lin.foa.se>
Cc: egcs@cygnus.com
Subject: Re: A problem with -ansi?
Date: Tue, 07 Apr 1998 19:34:00 -0000	[thread overview]
Message-ID: <199804071957.MAA25307@rtl.cygnus.com> (raw)
In-Reply-To: <199804030900.LAA08225@arnljot.lin.foa.se>

	#include <math.h>
	...
	res = erf(0.1);

Use of -ansi implies that you want an ANSI C compiler.  ANSI C specifies
exactly those functions that can be declared in the math.h header file.
This is so that implementations do not needlessly clutter the user namespace.
erf is not one of them, and hence when -ansi is used, math.h can not
declare the erf function.  If you have no declaration for erf, then the
compiler assumes it returns an int, and then silently converts the int
return value to double.  Hence this program can not work with -ansi.

Jim

      reply	other threads:[~1998-04-07 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-04 14:20 Christian Joensson FOA 72
1998-04-07 19:34 ` Jim Wilson [this message]

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=199804071957.MAA25307@rtl.cygnus.com \
    --to=wilson@cygnus.com \
    --cc=chj@lin.foa.se \
    --cc=egcs@cygnus.com \
    /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).