Error handling requirements of inlining code.
Doug Gwyn
gwyn at smoke.BRL.MIL
Mon Aug 28 14:54:17 AEST 1989
In article <20708 at sequent.UUCP> paulr at sequent.UUCP (Paul Reger) writes:
-For example, say the code:
-#include <math.h>
- double x;
- x = sqrt(-1.0);
-is given the compiler, and it decides to inline sqrt(). Would the
-standard require the compiler to also provide error handling of sqrt()
-according to the standard library ???
The in-line code doesn't have to agree with the library, but it does
have to conform to the Standard. On a domain error (as in your example),
EDOM must be stored in errno, and the function returns an implementation-
defined value (which may be a NaN, for example). An exception must not
be raised.
More information about the Comp.std.c
mailing list