https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80666
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #3 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Jos de Kloe from comment #2) > (In reply to Dominique d'Humieres from comment #1) > > Why do you think this a bug in gfortran? > > > > The code compiles if you remove 'implicit none'. With it you have to define > > 'keylen' before using it, as in you second test. > > We had the impression our code was correct since it compiles without problem > with pgf90 and ifort and older gfortran versions. I understand that extra > checks are added when the compiler evolves, and that the democratic argument > is maybe not applicable here, so if you think there is a rule in the fortran > standard that forbids this way of coding, feel free to point it out and we > can close the bug. Compiling the code in comment #0 with ifort gives: % ifort -c pr80666.f90 -stand pr80666.f90(3): warning #7346: The CHARACTER* form of a CHARACTER declaration is an obsolescent feature in Fortran 2003. character*(keylen), intent(in) :: key -------------^ pr80666.f90(3): warning #8586: Implicit type is given to allow out-of-order declaration. Non-standard extension. [KEYLEN] character*(keylen), intent(in) :: key -------------^ Or with Sun: % sunf95 -c pr80666.f90 -ansi integer, intent(in) :: keylen ^ "pr80666.f90", Line = 4, Column = 37: ANSI: Implicit typing is confirmed for object "KEYLEN". The Fortran standard requires typing before reference with IMPLICIT NONE. f90comp: 5 SOURCE LINES f90comp: 0 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 1 ANSI Just try to write standard conforming code if possible. And use the appropriate compiler checking option.