summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibM
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-07-06 06:27:27 +0200
committerGunnar Beutner <gunnar@beutner.name>2021-07-08 10:11:00 +0200
commite8e628de57789fea4c7266e71f7443fa70a75233 (patch)
tree8b2bed1c1a3bb60caf76c8fd9b044ec430e9e214 /Userland/Libraries/LibM
parent98a9a1d7f92d314df337af9745fcb58167e1c4e5 (diff)
downloadserenity-e8e628de57789fea4c7266e71f7443fa70a75233.zip
Everywhere: Add Clang pragmas
We use these to prevent UB from being optimized away in `/bin/crash` and to make the compiler not warn about the many implicit floating point type promotions in LibM.
Diffstat (limited to 'Userland/Libraries/LibM')
-rw-r--r--Userland/Libraries/LibM/math.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp
index 6599f9d9ed..121aa10d06 100644
--- a/Userland/Libraries/LibM/math.cpp
+++ b/Userland/Libraries/LibM/math.cpp
@@ -14,6 +14,11 @@
#include <stdint.h>
#include <stdlib.h>
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdouble-promotion"
+#endif
+
template<size_t>
constexpr double e_to_power();
template<>
@@ -1461,3 +1466,7 @@ float nearbyintf(float value) NOEXCEPT
return internal_to_integer(value, RoundingMode { fegetround() });
}
}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif