https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99184
--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- As a work-around, one can cast to an intermediate 64-bit integer: // For [u]int64_t and uint32_t, do #include <stdint.h> double x = 2.9; int x_int = (int) (int64_t) x; uint32_t x_u32 = (uint32_t) (uint64_t) x;