matherr -- pANSand OCS

Doug Gwyn gwyn at smoke.BRL.MIL
Tue May 16 06:19:55 AEST 1989


In article <120200005 at hcx2> daver at hcx2.SSD.HARRIS.COM writes:
>The 88open Trial Use OCS (3/10/89) lists 'matherr' as a service residing in 
>libm (see section 7.4).
>Can an implementation, then, be both ANSI C and 88k OCS compliant in this 
>regard?  Or can both "standards" be satisfied by having a routine such as
>'__matherr'?

I don't know what the OCS says, but there is no injunction in the C Standard
against an implementation providing additional functions in its C library,
so long as no constraint of the Standard is thereby violated.

The way this would have to be implemented would be for the math library
functions to call __matherr() and for <math.h> to #define matherr __matherr
as well as to declare struct exception.  However, such definitions of
reserved-for-application-use symbols must be controlled by some mechanism,
e.g. #ifdef _POSIX_SOURCE, that ensures that the definitions will not occur
when compiling in an ANSI-conforming mode.

Vendors with IEEE floating-point architectures are already angry enough
about having to mess around with errno; I can imagine what they must think
about having to call matherr().



More information about the Comp.std.c mailing list