================
@@ -37,26 +37,41 @@
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
-LIBC_INLINE int clear_except(int excepts) { return feclearexcept(excepts); }
+LIBC_INLINE int clear_except(int excepts) {
+#pragma STDC FENV_ACCESS ON
----------------
lntue wrote:
I don't think the fallback works:
```
// Portable fallback for GCC, MSVC, or older clang.
#define LIBC_FENV_ACCESS_ON _Pragma("STDC FENV_ACCESS ON")
```
https://godbolt.org/z/8bcdxojj9
We could add a compiler check to
https://github.com/llvm/llvm-project/blob/main/libc/cmake/modules/CheckCompilerFeatures.cmake
and pass that definition to all libc's targets.
You also need to remove the (Wno-fenv-access) flag that we added.
Let's move it to a separate PR if it doesn't break this PR.
https://github.com/llvm/llvm-project/pull/199009
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits