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.
This commit is contained in:
Daniel Bertalan 2021-07-06 06:27:27 +02:00 committed by Gunnar Beutner
commit e8e628de57
Notes: sideshowbarker 2024-07-18 10:05:52 +09:00
2 changed files with 14 additions and 1 deletions

View file

@ -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