[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new module 'fenv-environment'
|
From: |
Bruno Haible |
|
Subject: |
new module 'fenv-environment' |
|
Date: |
Sun, 05 Nov 2023 15:43:16 +0100 |
Here comes the module 'fenv-environment', which implements the ISO C 99
functions
fegetenv
feholdexcept
fesetenv
feupdateenv
and the macro
FE_DFL_ENV.
This is the largest module in the fenv-* series, because of the massive amount
of platform bugs that need to be worked around. No operating system gets all
four functions right on all CPUs! On many platforms, there's even two or three
bugs to work around together. Really, it feels like I'm the first person in the
world who has written unit tests for these functions.
Additionally, it has complexity because the fenv_t type is dependent on OS and
architecture. But fortunately, for most architectures, it is merely binary-
equivalent to an 'unsigned int' or 'unsigned long'.
2023-11-05 Bruno Haible <bruno@clisp.org>
fenv-environment: Add tests.
* tests/test-fenv-env-1.c: New file.
* tests/test-fenv-env-2.c: New file.
* tests/test-fenv-env-3.c: New file.
* tests/test-fenv-env-4.c: New file.
* tests/test-fenv-env-5.sh: New file.
* tests/test-fenv-env-5.c: New file.
* modules/fenv-environment-tests: New file.
fenv-environment: New module.
* lib/fenv.in.h (fenv_t) [hppa]: Remove the __exception field.
(FE_DFL_ENV): Override if <fenv.h> exists but HAVE_FE_DFL_ENV is not
defined.
(fegetenv, fesetenv, feupdateenv, feholdexcept): New declarations.
* lib/fenv-env.c: New file, based on glibc.
* lib/fenv-env-hold.c: New file.
* lib/fenv-env-update.c: New file.
* m4/fenv-environment.m4: New file.
* m4/mathfunc.m4 (gl_MATHFUNC): Handle also the 'fenv_t *' type.
* m4/fenv_h.m4 (gl_FENV_H_DEFAULTS): Initialize REPLACE_FEGETENV,
REPLACE_FEHOLDEXCEPT, REPLACE_FESETENV, REPLACE_FEUPDATEENV.
* modules/fenv (Makefile.am): Substitute REPLACE_FEGETENV,
REPLACE_FEHOLDEXCEPT, REPLACE_FESETENV, REPLACE_FEUPDATEENV.
* modules/fenv-environment: New file.
* doc/posix-functions/fegetenv.texi: Mention the new module and the bugs
on glibc, macOS, AIX.
* doc/posix-functions/feholdexcept.texi: Mention the new module and the
bugs on glibc, musl libc, FreeBSD, AIX, mingw, MSVC.
* doc/posix-functions/fesetenv.texi: Mention the new module and the bugs
on musl libc, FreeBSD, NetBSD, AIX, Solaris, Cygwin, mingw, MSVC.
* doc/posix-functions/feupdateenv.texi: Mention the new module and the
bugs on glibc, musl libc, macOS, FreeBSD, AIX, Solaris, mingw, MSVC.
0001-fenv-environment-New-module.patch
Description: Text Data
0002-fenv-environment-Add-tests.patch
Description: Text Data
- new module 'fenv-environment',
Bruno Haible <=