summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-30 13:09:57 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-30 13:09:57 -0500
commit46e4b9b12ec7d170691c2cb05970d6537633fa71 (patch)
tree8ffccf27d6b67825a0067cc3a3b1aa61d8a310a5
parentb2a8c069960b333c3cded9e0d68d9addee67f6fd (diff)
update standard and safety checks
-rw-r--r--src/fenv/feclearexcept.c11
-rw-r--r--src/fenv/fegetenv.c11
-rw-r--r--src/fenv/fegetexceptflag.c11
-rw-r--r--src/fenv/fegetround.c17
-rw-r--r--src/fenv/feholdexcept.c15
-rw-r--r--src/fenv/feraiseexcept.c11
-rw-r--r--src/fenv/fesetenv.c11
-rw-r--r--src/fenv/fesetexceptflag.c11
-rw-r--r--src/fenv/fesetround.c27
-rw-r--r--src/fenv/fetestexcept.c15
-rw-r--r--src/fenv/feupdateenv.c21
11 files changed, 65 insertions, 96 deletions
diff --git a/src/fenv/feclearexcept.c b/src/fenv/feclearexcept.c
index ca16cf3a..cf09adcd 100644
--- a/src/fenv/feclearexcept.c
+++ b/src/fenv/feclearexcept.c
@@ -1,21 +1,18 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int feclearexcept(int excepts)
{
+ SIGNAL_SAFE(0);
return excepts;
}
-/*d
+/*
The feclearexcept function clears the supported floating-point exceptions
represented by its argument.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fegetenv.c b/src/fenv/fegetenv.c
index 0f1cd0e2..ef68b8b6 100644
--- a/src/fenv/fegetenv.c
+++ b/src/fenv/fegetenv.c
@@ -1,22 +1,19 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fegetenv(fenv_t *envp)
{
+ SIGNAL_SAFE(0);
(void)envp;
return 0;
}
-/*d
+/*
The fegetenv function stores the current floating-point environment in the object
pointed to by envp.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fegetexceptflag.c b/src/fenv/fegetexceptflag.c
index c6847980..496b4f9d 100644
--- a/src/fenv/fegetexceptflag.c
+++ b/src/fenv/fegetexceptflag.c
@@ -1,23 +1,20 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fegetexceptflag(fexcept_t *flagp, int excepts)
{
+ SIGNAL_SAFE(0);
(void)flagp; (void)excepts;
return 0;
}
-/*d
+/*
The fegetexceptflag function stores an implementation-defined representation of
the states of the floating-point status flags indicated by the argument excepts in the
object pointed to by the argument flagp.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fegetround.c b/src/fenv/fegetround.c
index 39855a99..6aa133b7 100644
--- a/src/fenv/fegetround.c
+++ b/src/fenv/fegetround.c
@@ -1,26 +1,25 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
+
+#undef fegetround
int fegetround(void)
{
+ SIGNAL_SAFE(0);
return 0;
}
-/*d
+/*
The fegetround function gets the current rounding direction.
-d*/
+*/
-/*r
+/*
The fegetround function returns the value of the rounding direction macro
representing the current rounding direction or a negative value if there is no such
rounding direction macro or the current rounding direction is not determinable.
-r*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/feholdexcept.c b/src/fenv/feholdexcept.c
index b7f6d22c..7740ee58 100644
--- a/src/fenv/feholdexcept.c
+++ b/src/fenv/feholdexcept.c
@@ -1,29 +1,26 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int feholdexcept(fenv_t *envp)
{
+ SIGNAL_SAFE(0);
(void)envp;
return 0;
}
-/*d
+/*
The feholdexcept function saves the current floating-point environment in the object
pointed to by envp, clears the floating-point status flags, and then installs a non-stop
(continue on floating-point exceptions) mode, if available, for all floating-point
exceptions. 180)
-d*/
+*/
-/*r
+/*
The feholdexcept function returns zero if and only if non-stop floating-point
exception handling was successfully installed.
-r*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/feraiseexcept.c b/src/fenv/feraiseexcept.c
index 7ad17eb7..cc40934b 100644
--- a/src/fenv/feraiseexcept.c
+++ b/src/fenv/feraiseexcept.c
@@ -1,24 +1,21 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int feraiseexcept(int excepts)
{
+ SIGNAL_SAFE(0);
return excepts;
}
-/*d
+/*
The feraiseexcept function raises the supported floating-point exceptions
represented by its argument. 178) The order in which these floating-point exceptions are
raised is unspecified, except as stated in F.7.6. Whether the feraiseexcept function
additionally raises the ‘‘inexact’’ floating-point exception whenever it raises the
‘‘overflow’’ or ‘‘underflow’’ floating-point exception is implementation-defined.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fesetenv.c b/src/fenv/fesetenv.c
index c1b20e3c..2f2d07c6 100644
--- a/src/fenv/fesetenv.c
+++ b/src/fenv/fesetenv.c
@@ -1,25 +1,22 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fesetenv(const fenv_t *envp)
{
+ SIGNAL_SAFE(0);
(void)envp;
return 0;
}
-/*d
+/*
The fesetenv function establishes the floating-point environment represented by the
object pointed to by envp. The argument envp shall point to an object set by a call to
fegetenv or feholdexcept, or equal a floating-point environment macro. Note that
fesetenv merely installs the state of the floating-point status flags represented through
its argument, and does not raise these floating-point exceptions.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fesetexceptflag.c b/src/fenv/fesetexceptflag.c
index ee5eccb4..d40c7d8c 100644
--- a/src/fenv/fesetexceptflag.c
+++ b/src/fenv/fesetexceptflag.c
@@ -1,26 +1,23 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fesetexceptflag(const fexcept_t *flagp, int excepts)
{
+ SIGNAL_SAFE(0);
(void)flagp; (void)excepts;
return 0;
}
-/*d
+/*
The fesetexceptflag function sets the floating-point status flags indicated by the
argument excepts to the states stored in the object pointed to by flagp. The value of
*flagp shall have been set by a previous call to fegetexceptflag whose second
argument represented at least those floating-point exceptions represented by the argument
excepts. This function does not raise floating-point exceptions, but only sets the state
of the flags.
-d*/
+*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fesetround.c b/src/fenv/fesetround.c
index fa2369dd..3997adcf 100644
--- a/src/fenv/fesetround.c
+++ b/src/fenv/fesetround.c
@@ -1,28 +1,25 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fesetround(int round)
{
+ SIGNAL_SAFE(0);
return round;
}
-/*d */
-/* The fesetround function establishes the rounding direction represented by its */
-/* argument round. If the argument is not equal to the value of a rounding direction macro, */
-/* the rounding direction is not changed. */
-/* d*/
+/*
+The fesetround function establishes the rounding direction represented by its
+argument round. If the argument is not equal to the value of a rounding direction macro,
+the rounding direction is not changed.
+*/
-/*r */
-/* The fesetround function returns a zero value if and only if the argument is equal to a */
-/* rounding direction macro (that is, if and only if the requested rounding direction was */
-/* established). */
-/* r*/
+/*
+The fesetround function returns a zero value if and only if the argument is equal to a
+rounding direction macro (that is, if and only if the requested rounding direction was
+established).
+r*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/fetestexcept.c b/src/fenv/fetestexcept.c
index 6fb5374b..8c4b4bde 100644
--- a/src/fenv/fetestexcept.c
+++ b/src/fenv/fetestexcept.c
@@ -1,23 +1,23 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int fetestexcept(int excepts)
{
+ SIGNAL_SAFE(0);
return excepts;
}
-/*d
+/*
The fetestexcept function determines which of a specified subset of the floating-
point exception flags are currently set. The excepts argument specifies the floating-
point status flags to be queried. 179)
-d*/
+*/
-/*r
+/*
The fetestexcept function returns the value of the bitwise OR of the floating-point
exception macros corresponding to the currently set floating-point exceptions included in
excepts.
-r*/
+*/
/* example
#pragma STDC FENV_ACCESS ON
@@ -33,6 +33,3 @@ r*/
STDC(199901)
LINK(m)
*/
-
-
-#endif
diff --git a/src/fenv/feupdateenv.c b/src/fenv/feupdateenv.c
index 638509a1..805e4b92 100644
--- a/src/fenv/feupdateenv.c
+++ b/src/fenv/feupdateenv.c
@@ -1,25 +1,22 @@
-#if 0
-
#include <fenv.h>
+#include "_safety.h"
int feupdateenv(const fenv_t *envp)
{
+ SIGNAL_SAFE(0);
(void)envp;
return 0;
}
-/*d */
-/* The feupdateenv function saves the currently raised floating-point exceptions in its */
-/* automatic storage, installs the floating-point environment represented by the object */
-/* pointed to by envp, and then raises the saved floating-point exceptions. The argument */
-/* envp shall point to an object set by a call to feholdexcept or fegetenv, or equal a */
-/* floating-point environment macro. */
-/* d*/
+/*
+The feupdateenv function saves the currently raised floating-point exceptions in its
+automatic storage, installs the floating-point environment represented by the object
+pointed to by envp, and then raises the saved floating-point exceptions. The argument
+envp shall point to an object set by a call to feholdexcept or fegetenv, or equal a
+floating-point environment macro.
+d*/
/*
STDC(199901)
LINK(m)
*/
-
-
-#endif