Mail Archives: djgpp/2000/01/25/05:45:14
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 -