------- Comment #5 from burnus at gcc dot gnu dot org 2008-09-09 19:18 ------- Thinking it over, I think the program is INVALID per
"Two or more accessible entities, other than generic interfaces or defined operators, may have the same identifier only if the identifier is not used to refer to an entity in the scoping unit. Generic interfaces and defined operators are handled as described in section 16.2.3. Except for these cases, the local identifier of any entity given accessibility by a USE statement shall differ from the local identifiers of all other entities accessible to the scoping unit through USE statements and otherwise." (I couldn't find anything special about specification parts in modules - not that I expected to find something. The quote above is for Fortran 2003, but the same is true for Fortran 2008; I have not checked Fortran 90/95 but I do not expect a different result.) That the program is invalid solves a huge number of potential problems, some of which I eluded some in comment 4. I was about to ask at comp.lang.fortran, but decided that it is obvious enough that there is no need to do so. Note: I believe that already "subroutine putaline(...)" is invalid. -- Even though g95, NAG f95, ifort, Lahey, and openf95 accept it, but it is not the first time that a lot of compilers have the same bug. If you don't agree, please find the relevant section in the standard or ask someone to do so at comp.lang.fortran. gfortran is still buggy as it accepts the program (if one comments out "s3"). -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO|32834 | nThis| | Keywords| |accepts-invalid http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37445