https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84619
--- Comment #2 from Janne Blomqvist <jb at gcc dot gnu.org> --- size_t is the documented type, but for various reasons due to idiosyncrasies in the gfortran frontend, for the moment it emits a signed type the same size as size_t. Just use size_t, that should work fine.