With newer gfortran versions, integer wraparound should be enabled explicitly with the `-fwrapv` flag. See also, - https://gcc.gnu.org/onlinedocs/gfortran/Behavior-on-integer-overflow.html#:~:text=The%20behavior%20of%20gfortran%20on,detect%20such%20code%20at%20runtime. - https://fortran-lang.discourse.group/t/i-think-stdlib-should-have-printf-and-fprintf-with-c-style-formatting/6966/40?u=ivanpribec