X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f From: Kbwms AT aol DOT com Message-ID: <182.22490ddc.2ccfdd07@aol.com> Date: Tue, 28 Oct 2003 09:53:59 EST Subject: Re: C99 Functions Under Development and Checkout To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part1_182.22490ddc.2ccfdd07_boundary" X-Mailer: 8.0 for Windows sub 6021 Reply-To: djgpp-workers AT delorie DOT com --part1_182.22490ddc.2ccfdd07_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit A continuing problem that should be solved soon is not knowing what to do in the math functions when an error occurs. All function specifications at http://www.opengroup.org/onlinepubs/007904975/toc.htm contain the following text: On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero. At the moment, every function assumes that both expressions are non-zero because neither 'math-errhandling' nor 'MATH_ERREXCEPT' is defined. My intention is to implement the aforementioned variables and modify all existing code to check those expressions. At the beginning, both expressions will be non-zero. Appended to this email as a postscript are specifications taken from math.h at the linkage given above. Is this the desired behavior? KB Williams PS > The following macros shall expand to the integer constants 1 and 2, > respectively; > > > >> MATH_ERRNO >> MATH_ERREXCEPT >> > > The following macro shall expand to an expression that has type int and the > value MATH_ERRNO, MATH_ERREXCEPT, or the bitwise-inclusive OR of both: > >> math_errhandling >> > > The value of math_errhandling is constant for the duration of the program. > It is unspecified whether math_errhandling is a macro or an identifier with > external linkage. If a macro definition is suppressed or a program defines an > identifier with the name math_errhandling, the behavior is undefined. If the > expression (math_errhandling & MATH_ERREXCEPT) can be non-zero, the > implementation shall define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in . --part1_182.22490ddc.2ccfdd07_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable A continuing problem that should be solved soon is not k= nowing what to do in the math functions when an error occurs.  All func= tion specifications at

http://www= .opengroup.org/onlinepubs/007904975/toc.htm

contain the following text:

     On error, the expressions (math_errhandling & M= ATH_ERRNO) and
     (math_errhandling & MATH_ERREXCEPT) are indepen= dent of each
     other, but at least one of them must be non-zero.
At the moment, every function assumes that both expressions are non-zero bec= ause neither 'math-errhandling' nor 'MATH_ERREXCEPT' is defined.

My intention is to implement the aforementioned variables and modify all exi= sting code to check those expressions.  At the beginning, both expressi= ons will be non-zero.

Appended to this email as a postscript are specifications taken from math.h=20= at the linkage given above.


Is this the desired behavior?


KB Williams


PS



The following macros shall expa= nd to the integer constants 1 and 2, respectively;


MATH_ERRNO
MATH_ERREXCEPT


The following macro shall expand to an expression that has type int a= nd the value MATH_ERRNO, MATH_ERREXCEPT, or the bitwise-inclusive OR of both= :
math_errhandling


The value of math_errhandling is constant for the duration of the program. I= t is unspecified whether math_errhandling is a macro or an identifier with e= xternal linkage. If a macro definition is suppressed or a program defines an= identifier with the name math_errhandling, the behavior is undefined. If th= e expression (math_errhandling & MATH_ERREXCEPT) can be non-zero, the im= plementation shall define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFL= OW in .

--part1_182.22490ddc.2ccfdd07_boundary--