Suppress libdivide warnings in GCC/Clang

This commit is contained in:
Zwip-Zwap Zapony 2023-05-29 14:38:22 +02:00
parent eb1492fe6e
commit 05f1a9a2c8
2 changed files with 18 additions and 0 deletions

View file

@ -581,6 +581,11 @@ static inline void libdivide_u128_shift(uint64_t *u1, uint64_t *u0, int32_t sign
////////// UINT32
#if defined(__GNUC__) || defined(__clang__) // Suppress intentional compiler warnings
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggregate-return"
#endif
static inline struct libdivide_u32_t libdivide_internal_u32_gen(uint32_t d, int branchfree) {
struct libdivide_u32_t result;
uint32_t floor_log_2_d;
@ -647,6 +652,10 @@ struct libdivide_u32_t libdivide_u32_gen(uint32_t d) {
return ret;
}*/
#if defined(__GNUC__) || defined(__clang__) // Stop suppressing intentional compiler warnings
#pragma GCC diagnostic pop
#endif
uint32_t libdivide_u32_do(uint32_t numer, const struct libdivide_u32_t *denom) {
uint8_t more = denom->more;
if (!denom->magic) {

View file

@ -18,6 +18,11 @@
#define SPANSIZE 16
#define INVSPAN 0.0625f
#if defined(__GNUC__) || defined(__clang__) // Suppress intentional libdivide compiler warnings - Also added to libdivide.h
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggregate-return"
#endif
/** \brief The R_DrawSpan_NPO2_8 function
Draws the actual span.
*/
@ -1572,3 +1577,7 @@ void R_DrawTiltedWaterSpan_NPO2_8(void)
}
#endif
}
#if defined(__GNUC__) || defined(__clang__) // Stop suppressing intentional libdivide compiler warnings
#pragma GCC diagnostic pop
#endif