delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/25/05:45:14

Date: Tue, 25 Jan 2000 09:52:26 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Nate Eldredge <neldredge AT hmc DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: make depend
In-Reply-To: <83u2k3kwja.fsf@mercury.st.hmc.edu>
Message-ID: <Pine.SUN.3.91.1000125095209.23222P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 24 Jan 2000, Nate Eldredge wrote:

> If you don't include <math.h>, the implicit declaration of `sqrt' will
> be used: `int sqrt();'.

Yes.

> Does ANSI really expect every platform to work some magic to make this
> work anyhow?

The magic is to add this to the program:

  double sqrt();

The point is that any additional tricks the system headers play,
beyond declaring the prototypes, should not prevent a working program
to continue working if it doesn't include any of the headers.
Assuming, of course, that the source code doesn't rely on any
transformations of the arguments passed to functions beyond the normal
C promotion rules.

> Are there any that actually do?

All programs of the K&R era do this.  The whole point of this
requirement is to allow them to continue to work.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019