Compiling: program main implicit none integer(kind=8) :: i call system_clock(i) end program main with gfortran -std=f95 -pedantic -Wall -Wextra produces no warning. According to the F95 standard (13.14.106), "COUNT (optional) shall be scalar and of type default integer" (it's the same for COUNT_RATE and COUNT_MAX). It's not until F2003 (13.7.117) that the wording is changed to "COUNT (optional) shall be scalar and of type integer." Summary: using any other kind but default integer with system_clock should not be allowed or give a warning under -std=f95, but should be allowed for -std=f2003 and later.
I have a patch.
Author: fxcoudert Date: Sun Jun 15 16:58:53 2014 New Revision: 211686 URL: https://gcc.gnu.org/viewcvs?rev=211686&root=gcc&view=rev Log: PR fortran/28484 PR fortran/61429 * check.c (gfc_check_system_clock): Improve checking of arguments. * intrinsic.texi: Update doc of SYSTEM_CLOCK. * iresolve.c (gfc_resolve_system_clock): Choose library function used depending on argument kinds. * trans-decl.c (gfc_build_intrinsic_function_decls): Build decls for system_clock_4 and system_clock_8. * trans-intrinsic.c (conv_intrinsic_system_clock): New function. (gfc_conv_intrinsic_subroutine): Call conv_intrinsic_system_clock. * trans.h (gfor_fndecl_system_clock4, gfor_fndecl_system_clock8): New variables. * gfortran.dg/system_clock_1.f90: New file. * gfortran.dg/system_clock_2.f90: New file. Added: trunk/gcc/testsuite/gfortran.dg/system_clock_1.f90 trunk/gcc/testsuite/gfortran.dg/system_clock_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/check.c trunk/gcc/fortran/intrinsic.texi trunk/gcc/fortran/iresolve.c trunk/gcc/fortran/trans-decl.c trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/fortran/trans.h trunk/gcc/testsuite/ChangeLog
Fixed on trunk (4.10).