[libc-commits] [clang] [libc] Add clang warning if fp exception functions are called without appropriate flags/pragmas (PR #199009)

Marcos Ramirez Joos via libc-commits libc-commits at lists.llvm.org
Thu May 28 07:47:32 PDT 2026


================
@@ -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
----------------
maarcosrmz wrote:

I actually realised what you said just after pushing. If I'm not mistaken, the changes I just pushed should make it work, even for different targets (inspired by https://github.com/llvm/llvm-project/pull/198692/changes#diff-cbc6b94668e40294e8142de317bf19e528ab3fed9521f80d3ab11d7ddcfcce54).

Is this enough or should I still open a separate PR?

https://github.com/llvm/llvm-project/pull/199009


More information about the libc-commits mailing list