#include <limits.h>
+#include <mLib/macros.h>
+
#ifndef CATACOMB_MP_H
# include "mp.h"
#endif
/*----- Generic translation macros ----------------------------------------*/
+/* --- Warning damage control --- *
+ *
+ * GCC (at least) isn't clever enough to work out that the division in
+ * @MP_FROMINT@ is actually safe (since it will only be executed if @_i >
+ * MPW_MAX@, which would prove that @(type)MPW_MAX + 1 != 0@).
+ */
+
/* --- @MP_FROMINT@ --- *
*
* Arguments: @d@ = destination multiprecision integer
if (_i <= MPW_MAX) \
break; \
else \
- _i /= (type)MPW_MAX + 1; \
+ MUFFLE_WARNINGS_STMT(GCC_WARNING("-Wdiv-by-zero"), { \
+ _i /= (type)MPW_MAX + 1; \
+ }); \
} \
} else { \
_d->f |= MP_NEG; \
if (_i >= -MPW_MAX) \
break; \
else \
- _i /= (type)MPW_MAX + 1; \
+ MUFFLE_WARNINGS_STMT(GCC_WARNING("-Wdiv-by-zero"), { \
+ _i /= (type)MPW_MAX + 1; \
+ }); \
} \
} \
\