Wrong printf/scanf format specifiers used for MinGW targets
Modern MinGW C runtime versions (starting from GCC 6) have switched to C99/C++11 compliant printf/scanf format specifiers when <cstdio> include is used.
OTOH, when <stdio.h> include is used, MinGW still defaults to MS formats, but even then it can be overridden with
#define __USE_MINGW_ANSI_STDIO 1
For GCC 5 MinGW and older, <cstdio> behaved just like <stdio.h>.
verilatedos.h header still assumes that MinGW always uses MS formats, which breaks printing of 64-bit numbers on 32-bit MinGW GCC 6, 7 and 8. Compiling verilated.cpp also prints an array of printf format warnings with modern MinGW compilers for the 32-bit Windows target.
I've attached a patch which makes both old and new MinGW compilers use the standard printf formats. Older MinGW versions are just forced to use C99 formats with the above preprocessor definition.
Also available in: Atom